[Tutorial] Random spawns
#21

Nice!

Thank You!
Reply
#22

Thanks, great tutorial
Reply
#23

Great tutorial, everything is well explained.
Reply
#24

thx alot i needed it.
Reply
#25

hmm.. i have some problem..
but, Nice btw
Reply
#26

Thanks a lot! But how could I let not some skins get random spawned?
Reply
#27

Thanks for that nice Tut Helped n00bs
Reply
#28

nice JOb
Reply
#29

How to make random spawn for team,i mean, i have two teams and i need two other random spawn system
Reply
#30

like this or so:

Code:
if(team[playerid] == YOUR_TEAM]
{
new Float:RandomSpawns[][] = 
{
}
};
Reply
#31

What if you have more than one team ??
i mean how to assign (team1) to spawn at this RandomSpawns area, and (team2) in another RandomSpawns area ?

if you know what i mean !
Reply
#32

Quote:
Originally Posted by AnonScripter
View Post
What if you have more than one team ??
i mean how to assign (team1) to spawn at this RandomSpawns area, and (team2) in another RandomSpawns area ?

if you know what i mean !
You follow the tutorial twice. And then in OnPlayerSpawn you check which team the player is in and then get coordinates from the correct array.

pawn Code:
OnPlayerSpawn(etc)
{
     if(playerteam == team1)
     {
           //Spawn code for team 1
     }
     else if(playerteam == team2)
     {
           //Spawn code for team 2
     }
     return 1;
}
Reply
#33

Great tutorial.
PS, Sorry for bumping old thread, Meant to be elsewhere
Reply
#34

thank you FUNExtreme! this was useful.
Reply
#35

Huge thanks.
Reply
#36

Thank you Thank you !
Reply
#37

F:\PVP Server\gamemodes\pvp.pwn(403) : error 032: array index out of bounds (variable "RandomSpawns")
Can any one help me with this error, when I tried to create this command below, thats the error I recieved

CMD:joingame(playerid, params[])
{
new Random = random(sizeof(RandomSpawns));
SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);

return 1;
}
Reply
#38

F:\PVP Server\gamemodes\pvp.pwn(403) : error 032: array index out of bounds (variable "RandomSpawns")
Can any one help me with this error, when I tried to create this command below, thats the error I recieved

CMD:joingame(playerid, params[])
{
new Random = random(sizeof(RandomSpawns));
SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);

return 1;
}
Reply
#39

That means randomspawns is already defined.
Reply
#40

What about If I SetPlayerCheckpoint(playerid, RandomSpawn[random][0], RandomSpawn[random][1], RandomSpawn[random][2], 5);
And I wanna get if Player IsPlayerInRangeOfPoint of the random point in SetPlayerCheckpoint what will I do ?
Sorry for my bad English
Reply


Forum Jump:


Users browsing this thread: 37 Guest(s)