SAMP /GETALL Player CMD??? - Is this possible? With Timer?? - 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: SAMP /GETALL Player CMD??? - Is this possible? With Timer?? (
/showthread.php?tid=554763)
SAMP /GETALL Player CMD??? - Is this possible? With Timer?? -
S4MSUNG - 05.01.2015
The title ask , How can i make Get All player cmd? . With timer
Thanks in advance!
Imma give +rep
Respuesta: SAMP /GETALL Player CMD??? - Is this possible? With Timer?? -
xHanks - 05.01.2015
Quote:
Originally Posted by S4MSUNG
The title ask , How can i make Get All player cmd? . With timer
Thanks in advance!
Imma give +rep
|
Easy man, you can make a loop.
pawn Код:
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!");
}
Then you use the funciуn GetPlayerPos and apply SetPlayerPos to "i".
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.
Re: SAMP /GETALL Player CMD??? - Is this possible? With Timer?? -
Schneider - 05.01.2015
pawn Код:
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;
}
Re: Respuesta: SAMP /GETALL Player CMD??? - Is this possible? With Timer?? -
M4D - 05.01.2015
Quote:
Originally Posted by xHanks
Easy man, you can make a loop.
pawn Код:
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!"); }
Then you use the funciуn GetPlayerPos and apply SetPlayerPos to "i".
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.
|
pawn Код:
SendClientMessageToAll(-1, "Admin teleported all!");
will spam chat box !
use it out of loop or use send client message
Re: SAMP /GETALL Player CMD??? - Is this possible? With Timer?? -
S4MSUNG - 05.01.2015
THANK YOU GUYS SUPER MUCH APPRECIATED, PROBLEM SOLVED THANKS FOR HELPING ME
+REP TO ALL OF YOU <3