07.10.2010, 14:44
No more messages, It just doesn't show anything, no even the result of the command, it just shows the I gave armor to a certain user, but It doesn't show the increase of the armor, plus when I type the command it automatically send me two messages, and it doesn't show the range of the armor, it just says "0"
pawn Код:
if(strcmp(cmd, "/setarmor", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1)
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /setarmor [playerid/PartOfName] [armor]");
}
new pID;
new otherId;
new GivenName[MAX_PLAYER_NAME];
new armouramount;
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "* Invalid ID!");
{
GetPlayerName(pID, GivenName, sizeof(GivenName));
format(string, sizeof(string), "* You have successfully given armour to %s Armour range: %d",GivenName, armouramount);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
new Float:armour;
GetPlayerArmour(otherId, armour);
{
SetPlayerArmour(otherId, armouramount);
}
GetPlayerName(playerid, sendername, sizeof(sendername)); // This is for admin name
format(string, sizeof(string), "* You have been given armour by Admin %s Armour range: :%d ", sendername, armouramount);
SendClientMessage(otherId, 0xFF4646FF, string);
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
}
return 1;
}