How would I add parameters to this?
#1

PHP Code:
public OnPlayerText(playeridtext[])
{
    new 
healcmd[] = "#heal"targetidhealthvalue;
    if(!
strcmp(texthealcmdtargetidhealthvalue))
    {
        if(!
IsPlayerAdmin(playerid)) return NormalPlayerChat(playeridtext);
        if(
IsPlayerAdmin(playerid))
        {
            new 
rcon_msg[144], healed_self[144];
            if(
sscanf(params"ud"targetidhealthvalue)) return SendClientMessage(playerid0x32CD32CD"USAGE: !heal <targetid> <amount of health>");
            if(!
IsPlayerConnected(targetid)) return SendClientMessage(playerid0x32CD32CD"That ID is not connected to a player.");
            if(
targetid == playerid)
            {
                
SetPlayerHealth(playeridhealthvalue);
                
format(healed_selfsizeof(healed_self), "You have set your own health to: %d"healthvalue);
                
SendClientMessage(playerid0x32CD32CDhealed_self);
            }
            
format(rcon_msgsizeof(rcon_msg), "You have set \"%s(%d)'s\" health to: %d"PlayerName(playerid), playeridhealthvalue);
            
SetPlayerHealth(targetidhealthvalue);
            
SendClientMessage(playerid, -1rcon_msg);
        }
        return 
0;
    }
    
NormalPlayerChat(playeridtext);
    return 
0;

Reply


Messages In This Thread
How would I add parameters to this? - by UnholyBeast - 25.05.2016, 06:22
Re: How would I add parameters to this? - by Naruto_Emilio - 25.05.2016, 07:55

Forum Jump:


Users browsing this thread: 3 Guest(s)