Random Spawn
#1

hi guys please i need a simple Random Spawns

Any Help??
Reply
#2

Try this one :

One top of your scripts :

PHP код:
new Float:SpawnPoints[2][4] =
{
{-
1496.3367,904.7078,7.1875,90.4882}
}; 
What are these coords ?

X = -1496.3367
Y = 904.7078
Z = 7.1875
A = 90.4882

After that, Under OnPlayerSpawn, Add this :

PHP код:
new rnd random(sizeof(SpawnPoints));
SetPlayerPos(playerid,SpawnPoints[rnd][0],SpawnPoints[rnd][1],SpawnPoints[rnd][2]);
SetPlayerFacingAngle(playerid,SpawnPoints[rnd][3]); 
Hope this is useful.

KillerDVX,
Reply
#3

http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
Reply
#4

Quote:
Originally Posted by Threshold
Посмотреть сообщение
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
http://forum.sa-mp.com/search.php
Says it all.
Reply
#5

There's a good example in SA-MP Wiki: wiki.sa-mp.com/wiki/Random

PHP код:
new Float:RandomSpawn[][4] =
{
    
// Positions, (X, Y, Z and Facing Angle)
    
{-2796.98541224.818020.5429192.0335},
    {-
2454.2170503.875930.0790267.2932},
    {-
2669.7322, -6.08746.132889.8853}
};
 
 
public 
OnPlayerSpawn(playerid)
{
    new 
rand random(sizeof(RandomSpawn));
 
    
// SetPlayerPos to the random spawn data
    
SetPlayerPos(playeridRandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);
 
    
// SetPlayerFacingAngle to the random facing angle data
    
SetPlayerFacingAngle(playeridRandomSpawn[rand][3]);
    return 
1;

Reply
#6

No problem if you help him, instead of flooding a search link.
Reply
#7

Posting code and expecting them to understand is more pointless than giving them a tool to help themselves. The logical thing to do is to actually search for something if you seek it.

If you lose your keys, do you look for them before asking someone where they might be?
Reply
#8

Thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)