Quote:
Originally Posted by Drebin
pawn Код:
SetPlayerHealth(id, -10.0);
This set's the playerid's health to -10, but he wants to reduce the health by 10:
pawn Код:
CMD:slap(playerid,params[]) { new id, new Float:health; reason[128], adminname[MAX_PLAYER_NAME], pname[MAX_PLAYER_NAME]; GetPlayerName(id,pname,MAX_PLAYER_NAME); GetPlayerName(playerid,adminname,MAX_PLAYER_NAME); if(sscanf(params,"uz",id, reason)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /slap <playername/id> <reason>"); if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"ERROR: Player is not connected!"); GetPlayerHealth(id, health); SetPlayerHealth(id, health -10.0); PlayerPlaySound(1149,0,0,0,0); return 1; }
|
pawn Код:
new id,
new Float:health;
reason[128],
adminname[MAX_PLAYER_NAME],
pname[MAX_PLAYER_NAME];
There is already a new parameter.
Quote:
Originally Posted by GAMER_PS2
i only want is example my health is 100 when it gets slap it will be 90
|
Check the command I posted above.