Thread: Health System
View Single Post
  #3  
Old 02-09-2008, 03:13 PM
Knightmare1 Knightmare1 is offline
Billy Allan
Knightmare1's Avatar
Join Date: Apr 2007
Posts: 804
Knightmare1 can only hope to improve
Jazz, i meant how do i find the player whos im attacking. like if i attack some player, how would i make them get hurt.
this is what i have so far:
PHP Code:
function onActionServerSide() 
{ 
 if (
params[0] == "hurt") 
 { 
  
clientr.hp -= temp.player.clientr.weapon_damage;
 } 
 elseif (
params[0] == "dead")
 {
  
clientr.hp = 0;
  
clientr.dead = 1;
  
clientr.deaths += 1;
 }
 elseif (
params[0] == "kill")
 {
  
clientr.kills_@clientr.weapon += 1;
  
clientr.kills += 1;
  
clientr.exp += 4;
  
clientr.message = "You have killed " @temp.player_hit;
 }
 elseif (
params[0] == "revive")
 {
  
clientr.hp = clientr.hp_max;
  
setlevel2("final_osl.nw", 30, 30);
 }
 elseif (
params[0] == "attack")
 {
  
temp.player.clientr.hp -= clientr.weapon_damage;
 }
}

//#CLIENTSIDE
function onCreated()
{
 
clientr.hp = 100;
 
clientr.hp_max = 100;
 
clientr.deaths = 0;
 
clientr.kills = 0;
 
clientr.dead = 0;
 
setTimer( 0.05 );
}

function 
onTimeOut()
{
 if (
keydown(s))
 {
  
setAni("clientr.ani_attack","");  
  if (
temp.player.x = player.x + 1.5 && temp.player.y = player.y + 1.5 && temp.player.x = player.x - 1.5 && temp.player.y = player.y -1.5)
  {
   
triggerserver(gui,this.name,temp.player.account,"attack");
   if (
temp.player.clientr.hp == 0)
   {
    
triggerserver(gui,this.name,player.account,"kill");
   }
  }
 }
 if (
clientr.dead = 1)
 {
  if (
keydown(r))
  {
   
triggerserver(gui,this.name,"revive");
  }
 }
} 
__________________
I am the devil, I am here to do to devils work.

Last edited by Knightmare1; 02-09-2008 at 03:24 PM..
Reply With Quote