Need Help with /slap
#4

pawn Код:
SetPlayerHealth(id, -10.0);
This set's the playerid's health to -10, but he wants to reduce the health by 10.
Try this:

pawn Код:
CMD:slap(playerid,params[])
{
    new id;
    new Float:health;
    new reason[128];
    new adminname[MAX_PLAYER_NAME], pname[MAX_PLAYER_NAME];
    GetPlayerName(id,pname,MAX_PLAYER_NAME);
    GetPlayerName(playerid,adminname,MAX_PLAYER_NAME);
    if(sscanf(params,"us[128]",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;
}
Reply


Messages In This Thread
Need Help with /slap - by GAMER_PS2 - 11.11.2011, 12:38
Re: Need Help with /slap - by Cypress - 11.11.2011, 12:39
Re: Need Help with /slap - by Biesmen - 11.11.2011, 12:42
AW: Need Help with /slap - by Drebin - 11.11.2011, 12:45
Re: Need Help with /slap - by GAMER_PS2 - 11.11.2011, 12:49
Re: AW: Need Help with /slap - by Cypress - 11.11.2011, 12:51
Re: Need Help with /slap - by GAMER_PS2 - 11.11.2011, 12:54
Re: AW: Need Help with /slap - by Biesmen - 11.11.2011, 12:54
AW: Need Help with /slap - by Drebin - 11.11.2011, 12:55
Re: Need Help with /slap - by Cypress - 11.11.2011, 12:55

Forum Jump:


Users browsing this thread: 2 Guest(s)