02.01.2012, 06:55
Hello, i got a command which gives no errors or warnings but doesen't work.
Could anyone tell me what i'm doing wrong?
Could anyone tell me what i'm doing wrong?
pawn Код:
CMD:setarmors(playerid, params[]) // Sasoft
{
if (PlayerInfo[playerid][pAdmin] >= 3)
{
new string[128], radius, ar;
if(sscanf(params, "dd", ar, radius))
{
SendClientMessageEx(playerid, COLOR_GRAD6, "[Syntax]: /setarmors [armor] [radius]");
return 1;
}
if(radius < 1 || radius > 50)
{
SendClientMessageEx(playerid, COLOR_WHITE, "Radius must be higher than 0 and lower than 51!");
return 1;
}
if(ar < 1 || ar > 100)
{
SendClientMessageEx(playerid, COLOR_WHITE, "Armour must be higher than 1 and lower than 101!");
return 1;
}
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid,X, Y, Z);
for (new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(playerid, radius, X, Y, Z))
{
SetPlayerArmour(playerid, ar);
format(string, sizeof(string), "> Admin %s uses his magic and shoots a wave of armour in your direction.", GetPlayerNameEx(playerid));
SendClientMessageEx(playerid, COLOR_LIGHTGREEN, string);
}
}
format(string, sizeof(string), "You have given everyone %d armour in %d radius", ar, radius);
SendClientMessageEx(playerid, COLOR_LIGHTGREEN, string);
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
}
return 1;
}