isplayerinrange... - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: isplayerinrange... (
/showthread.php?tid=309165)
isplayerinrange... -
Tanush123 - 06.01.2012
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;
}
Re: isplayerinrange... -
park4bmx - 06.01.2012
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