setplayerhealth
#8

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
As the above members already suggested, ZCMD and sscanf is a very good combination for commands.

PHP код:
CMD:sethealth(playeridparams[])
{
    new
        
id,
        
Floatamount;
    
    if (
sscanf(params"rf"idamount)) return SendClientMessage(playerid, -1"Usage: /sethealth <ID/Part Of Name> <amount>");
    if (
id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1"Invalid player");
    
//if (!(0.0 <= amount <= 100.0)) return SendClientMessage(playerid, -1, "You can set an amount of health between 0.0 and 100.0");
    
    
SetPlayerHealth(idamount);
    return 
1;

@Jamester: "h" specifier is for hex.
since samp 0.3 the SetPlayerHealth amount is not float. As I know
Reply


Messages In This Thread
setplayerhealth - by ArcNuke - 31.05.2015, 11:45
Re: setplayerhealth - by J0sh... - 31.05.2015, 11:46
Re: setplayerhealth - by amirm3hdi - 31.05.2015, 11:47
Re: setplayerhealth - by Konstantinos - 31.05.2015, 11:55
Re: setplayerhealth - by SoFahim - 31.05.2015, 13:15
Re: setplayerhealth - by J0sh... - 31.05.2015, 13:27
Re: setplayerhealth - by SoFahim - 31.05.2015, 15:33
Re: setplayerhealth - by bgedition - 31.05.2015, 15:38
Re: setplayerhealth - by Konstantinos - 31.05.2015, 15:42
Re: setplayerhealth - by bgedition - 31.05.2015, 15:44

Forum Jump:


Users browsing this thread: 2 Guest(s)