How to SetPlayerPos for all the players?
#9

Quote:
Originally Posted by [MG]Dimi
Посмотреть сообщение
PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if (!
strcmp("/bringall"cmdtexttrue))
    {
        new 
Float:Pos[3],pName[24],string[128];
        
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
        
GetPlayerName(playerid,pName,sizeof(pName));
        
format(string,128,"%s(%d) has brought everyone to his position!",pName,playerid);
        
SendClientMessageToAll(0xFF0000FF,string);
        for(new 
i=0;i<MAX_PLAYERS;i++)
        if(
IsPlayerConnected(playerid))
        {
            
SetPlayerPos(i,Pos[0],Pos[1],Pos[2]);
            return 
1;
        }
        return 
1;
    }
    return 
0;

That will fail since as soon as it sets one players position it will return out of the function remove the return from the loop.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 5 Guest(s)