02.10.2017, 02:33
Hey guys i made this commmand but i am new in this lenguage of pawn and i dont know why my comands still not working i have no errors or warnings but always i use /sethp always kill me and never put the % of life i want to give...and with /sethp nothing happens, what can i do? by the way sorry for my bad english
this is my code :
this is my code :
PHP код:
CMD:sethp(playerid,params[])
{
if(IsPlayerConnected(playerid))
{
new id,Float:c;
if(sscanf(params,"rf",id,c))
{
SendClientMessage(playerid, COLOR_GRAD, "USAGE: /sethp [Playerid/PartOfName] [Health]");
return 1;
}
if (PlayerInfo[playerid][pAdmin] >= 4)
{
if(IsPlayerConnected(id))
{
if(id!= INVALID_PLAYER_ID)
{
SetPlayerHealth(id, c);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD, "You are not authorized to use that command!");
}
}
return 1;
}
CMD:setarmor(playerid,params[])
{
if(IsPlayerConnected(playerid))
{
new id,Float:c;
if(sscanf(params,"rf",id,c))
{
SendClientMessage(playerid, COLOR_GRAD, "USAGE: /setarmor [Playerid/PartOfName] [Armor]");
return 1;
}
if (PlayerInfo[playerid][pAdmin] >= 4)
{
if(IsPlayerConnected(id))
{
if(id!= INVALID_PLAYER_ID)
{
SetPlayerArmour(id, c);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD, "You are not authorized to use that command!");
}
}
return 1;
}