View Single Post
  #6  
Old 09-07-2010, 07:02 AM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
class
PHP Code:
function addExp(amount){
  
clientr.exp += amount;

baddy
PHP Code:
join("player_functions");
function 
onActionServerside(cmd){
  switch (
cmd){
    case 
"addexp":
      
addExp(amount);
      break;
  }
}
//#CLIENTSIDE
function onCheckDead(){
  
// do checks
  
triggerserver("gui"name"addexp"); 

However joining the player to the class on login could simplify it and make it a bit more accessible. Using the same class you can just do player.addExp(amount); anywhere serverside by doing this on login.

PHP Code:
  player.join("player_functions"); 
then your code would look like this
PHP Code:
function onActionServerside(cmd){
  switch (
cmd){
    case 
"addexp":
      
player.addExp(amount);
      break;
  }
}
//#CLIENTSIDE
function onCheckDead(){
  
// do checks
  
triggerserver("gui"name"addexp"); 

Reply With Quote