Event sistem help
#1

Hi , i'm trying to create my own event system and i do not know how to make the server to set joining player's pos to a specific one and than use the rest of the empty positions
Reply
#2

Bump
Reply
#3

PHP код:
CMD:startevent(playeridprams[])
{
        If(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1"You are not a admin to start a event");//Check if the player is admin  
    
for (new 0GetMaxPlayers(); i++)//loop throught all the players
    
{
        if(
IsPlayerConnected(i) && !IsPlayerNPC(i))//check if player is connected and if its not a BOT
        
{
                     
SetPlayerPos(ix,y,z);// Set the player PoS X, Y, Z
                     
GivePlayerWeapon(playerid2699999);// Gives Players sawn-off shotgun to fight
                     
GameTextForAll(i"~r~Sawn-off shotgun",5000,3);//Game Text For All Players
                 
}
        }
        return 
1;

This may give you an idea
Reply
#4

Well , thank you but it's not what i asked
I aked something like :
Getrandompos {
X Y Z
A B C
Etc.
}
The first player that joins gets the X Y Z pos , the secondat one gets A B C pos and so on but the 2 players can't get the same pos
Reply
#5

Add tis in the top of your script!

PHP код:
new Float:RandomSpawns[][] = 
{
    {
xyzAngle}, // Randomspawn
    
{xyzAngle}, // Randomspawn
    
{xyzAngle}, // Randomspawn
    
{xyzAngle}, // Randomspawn
    
{xyzAngle// Randomspawn
}; 
And this in your command!
PHP код:
new Random random(sizeof(RandomSpawns));
    
SetPlayerPos(playeridRandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
    
SetPlayerFacingAngle(playeridRandomSpawns[Random][3]); 
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)