random spawns
#8

Quote:
Originally Posted by Jstylezzz
View Post
You might want to look at the size of the random positions array. There are 6 entries, while you set the size to 4. This will make it exceed its declared size.

PHP Code:
#include <a_samp>
new Float:RandomSpawn[][6] =
{
    {-
480.6924,2189.9875,41.8672},  // Dam LV
    
{271.9112,-1867.8492,2.7009},  // Aqua Park LS
    
{379.7065,2537.1069,16.5391}, // Abandoned Airport
    
{2075.2749,-2535.3286,13.5469}, // Airport LS
    
{-2343.2390,-1636.1138,483.7031}, // Mount Chilliad
    
{-2619.8066,1396.3444,7.1016// Jizzy's SF
};
public 
OnPlayerSpawn(playerid)
{
    new 
rand random(sizeof(RandomSpawn));
    
SetPlayerPos(playeridRandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);
    return 
1;

This should work.
sorry thx for telling
Reply


Messages In This Thread
random spawns - by Lukasz56 - 03.04.2018, 16:54
Re: random spawns - by Jstylezzz - 03.04.2018, 16:58
Re: random spawns - by Jstylezzz - 03.04.2018, 17:07
Re: random spawns - by Lokii - 03.04.2018, 17:08
Re: random spawns - by Jstylezzz - 03.04.2018, 17:12
Re: random spawns - by Lukasz56 - 03.04.2018, 17:13
Re: random spawns - by Jstylezzz - 03.04.2018, 17:14
Re: random spawns - by Lokii - 03.04.2018, 17:15

Forum Jump:


Users browsing this thread: 1 Guest(s)