24.04.2011, 18:19
Hello everyone.
I've made a /slap command,here it is:
I've also tested it,but the problem is that it always says: XXX has -25768917859845 health remaining
Can anyhelp help me fix that issue? It is so irritating ^^
Thanks and Happy Easter!
I've made a /slap command,here it is:
pawn Код:
if(strcmp(cmd, "/slap", true) == 0)
{
tmp = strtok(cmdtext, idx);
new otherplayer = strval(tmp);
tmp2 = strtok(cmdtext, idx);
new senderid = strval(tmp2);
tmp3 = strtok(cmdtext, idx);
new getterid = strval(tmp3);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_USAGE, "USAGE: /slap [playerid]");
if(!IsPlayerConnected(otherplayer)) return SendClientMessage(playerid, COLOR_WARNING, "Warning: Wrong ID/Player is not connected!");
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(otherplayer, giveplayer, sizeof(giveplayer));
new Float:HH;
GetPlayerHealth(playerid, HH);
SetPlayerHealth(playerid,HH-10);
GetPlayerHealth(playerid, HH);
format(String, sizeof(String), "Admin %s(ID:%d) slapped %s(ID:%d)! %s has %.1f health remaning!",sendername,senderid,otherplayer,getterid,otherplayer,HH);
SendClientMessageToAll(COLOR_PEACH, String);
PlaySoundForAll(1190,0.0,0.0,0.0);
return 1;
}
Can anyhelp help me fix that issue? It is so irritating ^^
Thanks and Happy Easter!