Random Spawn
#1

I have problem,i choose this cord,but when i join in-game it spawn players in different area not in anyone of these one?



Код:
new Float:RandomSpawn[][] = {
{1024.5215,-1335.2686,13.5441,1.6310},
{490.4999,-1511.4652,20.5050,95.9661},
{1815.0850,-1876.9589,13.5781,273.1859},
{2020.7937,-1271.2987,23.9844,4.2513},
{2724.2773,-2042.3345,13.5507,90.5602}


};
Reply
#2

PHP код:
new Float:RandomSpawn[5][4] = {
{
1024.5215,-1335.2686,13.5441,1.6310},
{
490.4999,-1511.4652,20.5050,95.9661},
{
1815.0850,-1876.9589,13.5781,273.1859},
{
2020.7937,-1271.2987,23.9844,4.2513},
{
2724.2773,-2042.3345,13.5507,90.5602}
};
public 
OnPlayerSpawn(playerid)
{
    new 
rand random(sizeof(RandomSpawn));
    
SetPlayerPos(playeridRandomSpawn[rand][0], RandomSpawn[rand][1], RandomSpawn[rand][2]);
    
SetPlayerFacingAngle(playeridRandomSpawn[rand][3]);
    return 
1;

Float:RandomSpawn[5][4]

[5] = amount of spawn positions you have
[4] = amount of floats in the variable, in this case: X, Y, Z and ANGLE

Also, are you using the grand larceny script? If yes, remove this from OnPlayerSpawn:

PHP код:
if(CITY_LOS_SANTOS == gPlayerCitySelection[playerid]) {
         
randSpawn random(sizeof(gRandomSpawns_LosSantos));
         
SetPlayerPos(playerid,
         
gRandomSpawns_LosSantos[randSpawn][0],
         
gRandomSpawns_LosSantos[randSpawn][1],
         
gRandomSpawns_LosSantos[randSpawn][2]);
        
SetPlayerFacingAngle(playerid,gRandomSpawns_LosSantos[randSpawn][3]);
    }
    else if(
CITY_SAN_FIERRO == gPlayerCitySelection[playerid]) {
         
randSpawn random(sizeof(gRandomSpawns_SanFierro));
         
SetPlayerPos(playerid,
         
gRandomSpawns_SanFierro[randSpawn][0],
         
gRandomSpawns_SanFierro[randSpawn][1],
         
gRandomSpawns_SanFierro[randSpawn][2]);
        
SetPlayerFacingAngle(playerid,gRandomSpawns_SanFierro[randSpawn][3]);
    }
    else if(
CITY_LAS_VENTURAS == gPlayerCitySelection[playerid]) {
         
randSpawn random(sizeof(gRandomSpawns_LasVenturas));
         
SetPlayerPos(playerid,
         
gRandomSpawns_LasVenturas[randSpawn][0],
         
gRandomSpawns_LasVenturas[randSpawn][1],
         
gRandomSpawns_LasVenturas[randSpawn][2]);
        
SetPlayerFacingAngle(playerid,gRandomSpawns_LasVenturas[randSpawn][3]);
    } 
Reply
#3

Thank you but it's not working i will try with my mode i took one but it's shitty anyway thank you.
Reply
#4

Quote:
Originally Posted by Panten
Посмотреть сообщение
Thank you but it's not working i will try with my mode i took one but it's shitty anyway thank you.
Can you post your OnPlayerSpawn?
Reply
#5

I deleted mode which i found,now i will start from zero!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)