[Help]
#5

Phew, the whole code is fucked up.
Here's a fix.
I have only fixed the errors, I didn't check wether the command actually works.
It should work though.

pawn Код:
CMD:sethp(playerid, params[], help)
{
    if(PlayerInfo[playerid][pRank] == 2.6) {
        new string[128],targetid,Float:Heal,Pname[MAX_PLAYER_NAME],Iname[MAX_PLAYER_NAME];
        GetPlayerName(playerid,Pname,sizeof(Pname));
        GetPlayerName(targetid,Iname,sizeof(Iname));
        if(sscanf(params, "ud", targetid,Heal))
        {
            SendClientMessage(playerid,-1,"USAGE: /SetHealth (Player Name/ID) (Health)");
            return 1;
        }
        else if(!IsPlayerConnected(targetid))
        {
            format(string,sizeof(string),"The Player ID (%d) is not connected to the server. You cannot heal them.",targetid);
            SendClientMessage(playerid,-1,string);
            return 1;
        } else {
            SetPlayerHealth(playerid,Heal);
            format(string,sizeof(string),"You Have Set %s(%d) Health To %d",Iname,targetid,Heal);
            SendClientMessage(playerid,-1,string);
            format(string,sizeof(string),"%s(%d) Has Set Your Health To %d",Pname,playerid,Heal);
            SendClientMessage(targetid,-1,string);
            SetPlayerHealth(targetid, Heal);
        }
    }
    return 1;
}
Reply


Messages In This Thread
[Help] - by astanalol - 22.12.2014, 19:46
Re: [Help] - by setes7 - 22.12.2014, 20:08
Re: [Help] - by Ox1gEN - 22.12.2014, 20:22
Re: [Help] - by astanalol - 22.12.2014, 21:09
Re: [Help] - by Ox1gEN - 22.12.2014, 21:17
Re: [Help] - by UltraScripter - 22.12.2014, 21:18
Re: [Help] - by astanalol - 22.12.2014, 21:52
Re: [Help] - by Ox1gEN - 22.12.2014, 21:59
Re: [Help] - by astanalol - 22.12.2014, 22:17
Re: [Help] - by Ox1gEN - 22.12.2014, 22:20

Forum Jump:


Users browsing this thread: 1 Guest(s)