20.05.2015, 16:36
There Are Some Commands In My Script That Shows The Error Message On Using Them
Ex
When I Use This Commad I get The Error Message "You Cannot Use This Command While You're Dead"
Ex
PHP код:
COMMAND:setarmour(playerid,params[])
{
if(PlayerInfo[playerid][pSpawned] == 1)
{
if(PlayerInfo[playerid][pAdminLevel] > 0)
{
new TargetID, Float:Armour, string[128];
if(sscanf(params,"uf", TargetID, Armour))
{
SendClientMessage(playerid,COLOR_ERROR,"USAGE: /setarmour [playerid] [Armour]");
return 1;
}
if(!IsPlayerConnected(TargetID) || TargetID == INVALID_PLAYER_ID)
{
SendClientMessage(playerid, COLOR_ERROR, "That Player Is Not Connected.");
return 1;
}
if(Armour < 0 || Armour > 100)
{
SendClientMessage(playerid, COLOR_ERROR, "Armour Can't Be Less Than 0 or More Than 100.");
return 1;
}
SetPlayerArmour(TargetID,Armour);
GameTextForPlayer(TargetID,"~r~Armour Set By Admin", 3000, 3);
format(string,sizeof(string),"***ARMOUR: %s (%d) (ADMIN SETARMOUR) Has Been Set.", PlayerInfo[TargetID][pName], TargetID);
SendClientMessageToAll(COLOR_ADMIN, string);
}else{
SendClientMessage(playerid, COLOR_ERROR, "You Cannot Use This Command While You're Dead.");
}
return 1;
}