im creating a health system for my server, and i was wondering, how do you make sure that when you damage a player that you can tell you killed them. this is what i have so far. I only spent a couple of minutes, and i was wondering, can anyone help me? i am not to good at scripting. and the server is gonna have a ranking system ( like ranks for each class. ) and class system. im still working on everything, because i have no staff xD
PHP Code:
function onActionServerSide()
{
if (params[0] == "hurt")
{
clientr.hp -= clientr.weapon_damage;
}
elseif (params[0] == "dead")
{
clientr.hp = 0;
clientr.deaths += 1;
}
elseif (params[0] == "kill")
{
clientr.kills_@clientr.weapon += 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);
}
}
//#CLIENTSIDE
function onCreated()
{
clientr.hp = 100;
clientr.hp_max = 100;
clientr.deaths = 0;
clientr.kills = 0;
setTimer( 0.05 );
}