20.02.2016, 14:49
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
CMD:startevent(playerid, prams[])
{
If(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You are not a admin to start a event");//Check if the player is admin
for (new i = 0; i < GetMaxPlayers(); i++)//loop throught all the players
{
if(IsPlayerConnected(i) && !IsPlayerNPC(i))//check if player is connected and if its not a BOT
{
SetPlayerPos(i, x,y,z);// Set the player PoS X, Y, Z
GivePlayerWeapon(playerid, 26, 99999);// Gives Players sawn-off shotgun to fight
GameTextForAll(i, "~r~Sawn-off shotgun",5000,3);//Game Text For All Players
}
}
return 1;
}
new Float:RandomSpawns[][] =
{
{x, y, z, Angle}, // Randomspawn
{x, y, z, Angle}, // Randomspawn
{x, y, z, Angle}, // Randomspawn
{x, y, z, Angle}, // Randomspawn
{x, y, z, Angle} // Randomspawn
};
new Random = random(sizeof(RandomSpawns));
SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);