05.01.2015, 00:31
The title ask , How can i make Get All player cmd? . With timer
Thanks in advance!
Imma give +rep
Thanks in advance!
Imma give +rep
The title ask , How can i make Get All player cmd? . With timer
Thanks in advance! Imma give +rep |
for(new i = 0;i < MAX_PLAYERS; i++)
{
new Float:Pos[3];
GetPlayerPos(playerid,Pos[1],Pos[2],Pos[3]);
SetPlayerPos(i,Pos[1],Pos[2],Pos[3])
SendClientMessageToAll(-1, "Admin teleported all!");
}
COMMAND:getall(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return 0;
SetTimerEx("GetAllPlayers", 5000, 0, "i", playerid);
SendClientMessageToAll(-1, "You will all be teleported to admin in 5 seconds....");
return 1;
}
forward GetAllPlayers(playerid);
public GetAllPlayers(playerid)
{
new Float:X, Float:Y, Float:Z, Float:iX, Float:iY;
GetPlayerPos(playerid, X, Y, Z);
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInAnyVehicle(i)) RemovePlayerFromVehicle(i);
iX = floatadd(floatsub(random(30), 15.0), X);
iY = floatadd(floatsub(random(30), 15.0), Y);
SetPlayerPos(i, iX, iY, (Z+1.0));
SendClientMessage(i, -1, "You've been teleported to the admin");
}
}
return 1;
}
Easy man, you can make a loop.
pawn Код:
I'm on my phone and i can't make the code now. Search loop con sa-mp wiki and you will make it fast. |
SendClientMessageToAll(-1, "Admin teleported all!");