How to create a command to bring everyone
#7

Quote:
Originally Posted by HurtLocker
Посмотреть сообщение
You don't have to get the playerid's player position in every loop and also you dont have to take as many coordinates sets as the slots of the server are.


Here is the most timesaving (without foreach) command:
pawn Код:
if(!strcmp("/getall", cmdtext, true))
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if (IsPlayerConnected(i))
        {
            SetPlayerPos(i,x,y,z);
        }
    }
    return 1;
}
I got errors with this so i tried the code from Guest123 and i didn't get any errors. I''ll try in-game now. Thanks.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)