Radius. (WARNING)
#5

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;
}
Reply


Messages In This Thread
Radius. (WARNING) - by Sasoft - 30.12.2011, 10:09
Re: Radius. (WARNING) - by T0pAz - 30.12.2011, 10:14
Re: Radius. (WARNING) - by silvan - 30.12.2011, 12:02
Re: Radius. (WARNING) - by FTLOG - 30.12.2011, 12:20
Re: Radius. (WARNING) - by Sasoft - 30.12.2011, 18:17
Re: Radius. (WARNING) - by Elmin - 30.12.2011, 19:41

Forum Jump:


Users browsing this thread: 1 Guest(s)