Quote:
Originally Posted by FuNkYTheGreat
PHP код:
CMD:setarmor(playerid, params[])
{
new playa, Float:armor;
if(PlayerInfo[playerid][pAdmin] >= 3 || PlayerInfo[playerid][pEventModd] > 0)
{
if(!sscanf(params, "uf", playa, armor))
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
strmid(giveplayer, PlayerICName(playa), 0, MAX_PLAYER_NAME);
SetPlayerArmour(playa, armour);
format(str, sizeof(str), "You have set %s's armor to %.1f.", giveplayer, armor);
SendClientMessage(playerid, COLOR_GREY, str);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "{00BFFF}Usage:{FFFFFF} /setarmor [playerid/PartOfName] [armor]");
}
}
else
{
AdmErrorMsg;
}
return 1;
}
The problem was very simple, Because armor is not just a random number, It's a float, same as health.
|
Not working mate. Any help would be appreciated.