30.12.2011, 18:17
Alright thanks, so this will work?
pawn Код:
CMD:setskins(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 3)
{
new string[128], skin, Float:radius;
if(sscanf(params, "df", skin, radius))
{
SendClientMessageEx(playerid, COLOR_GRAD6, "[Syntax]: /setskins [skin] [radius]");
return 1;
}
if(!IsInvalidSkin(skin))
{
SendClientMessageEx(playerid, COLOR_GREY, "Invalid skin ID!");
return 1;
}
if(radius < 1 || radius > 50)
{
SendClientMessageEx(playerid, COLOR_WHITE, "Radius must be higher than 0 and lower than 51!");
return 1;
}
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid,X, Y, Z);
for (new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, radius, X, Y, Z))
{
SetPlayerSkin(i,skin);
}
}
format(string, sizeof(string), "You have given everyone skin %d in %d radius", skin, radius);
SendClientMessageEx(playerid, COLOR_LIGHTGREEN, string);
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
}
return 1;
}