26.03.2011, 09:21
(
Последний раз редактировалось mrcoolballs; 05.08.2011 в 05:02.
)
EDIT: No one seemed to answer my last question so I'm going to attempt to explain it better.
Is there any possible way to check if the ID part of a command is not there?
For example a /sethealth <Name> <Health> command would set the health of the name given to the health specified, but if I don't add a name in there I want it to set the health of me to the health i type
But obviously this wont work because "id", is not a string, if anyone can understand what I'm trying to make here, could you please give me a hand
Is there any possible way to check if the ID part of a command is not there?
For example a /sethealth <Name> <Health> command would set the health of the name given to the health specified, but if I don't add a name in there I want it to set the health of me to the health i type
pawn Код:
dcmd_sethealth(playerid,params[])
{
new id, health;
if(sscanf(params,"ii",id,health)) return 0;
if(!strlen(id))
{
SetPlayerHealth(playerid,health);// The <Name> part of the command has not been entered, so by default it will choose the player who typed the command
}
else
{
SetPlayerHealth(id,health);// The <Name> part of the command has been entered so the health of the ID entered will be set
}
return 1;
}