Event sistem help - 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: Event sistem help (
/showthread.php?tid=601368)
Event sistem help -
TheDarkBlade - 20.02.2016
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
Re: Event sistem help -
TheDarkBlade - 20.02.2016
Bump
Re: Event sistem help -
TuFF12 - 20.02.2016
PHP код:
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;
}
This may give you an idea
Re: Event sistem help -
TheDarkBlade - 20.02.2016
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
Re: Event sistem help -
TuFF12 - 20.02.2016
Add tis in the top of your script!
PHP код:
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
};
And this in your command!
PHP код:
new Random = random(sizeof(RandomSpawns));
SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);