isplayerinrange...
#1

Well i want if player is near the admin that uses /countdown, it freeze people around him (i test it and froze everyone in the server)
pawn Код:
CMD:countdown(playerid,params[])
{
    if(PlayerData[playerid][AdminLevel] < 2) return 0;
    GetPlayerPos(playerid,X,Y,Z);
    GetPlayerName(playerid,Nam,sizeof(Nam));
    format(str,sizeof(str),"%s has started a countdown",Nam);
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerInRangeOfPoint(i,5,X,Y,Z))
        {
            TogglePlayerControllable(i,0);
            SetTimer("countdown3",1000,0);
            GameTextForAll("~g~3",1000,3);
            SendClientMessage(i,COLOR_YELLOW,str);
        }
    }
    return 1;
}
Reply
#2

pawn Код:
CMD:countdown(playerid,params[])
{
for(new i=0; i<MAX_PLAYERS; i++)
{
If(PlayerData[i][AdminLevel]>0)
{
GetPlayerPos(I,X,Y,Z);
GetPlayerName(playerid,Nam,sizeof(Nam));
format(str,sizeof(str),"%s has started a countdown",Nam);
}else return 0;
if(IsPlayerInRangeOfPoint(i,5,X,Y,Z))
{
TogglePlayerControllable(i,0);
SetTimer("countdown3",1000,0);
GameTextForAll("~g~3",1000,3);
SendClientMessage(i,COLOR_YELLOW,str);
}
}
return 1;
}
I'm sorry the way its set up but I made this wih my phone
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)