SA-MP Forums Archive
Wrong Coordonates? - 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: Wrong Coordonates? (/showthread.php?tid=612702)



Wrong Coordonates? - Zeus666 - 20.07.2016

PHP код:
new Float:randomSpawns_DayZSA_Part1[4][4] =
{
 {
2899.3059 ,-1624.4517 ,11.8779},
 {
2457.3726 ,-1666.8768 ,14.1584},
 {
2093.8362 ,-1773.7025 ,14.3506},
 (
2679.3730 ,-1540.8654 ,25.6224)
};
    if(
pInfo[playerid][pFirstSpawn] == 1)
        {
            new 
randSpawn random(sizeof(randomSpawns_DayZSA_Part1));
            
SetPlayerPos_Allow(playerid,randomSpawns_DayZSA_Part1[randSpawn][0],randomSpawns_DayZSA_Part1[randSpawn][1],randomSpawns_DayZSA_Part1[randSpawn][2]); 

Sometimes, it spawns me in that zone of Blueberry. I don't know why.


All of the coordonates seems to be working.


Re: Wrong Coordonates? - FuNkYTheGreat - 20.07.2016

change this
PHP код:
          new randSpawn random(sizeof(randomSpawns_DayZSA_Part1));
            
SetPlayerPos_Allow(playerid,randomSpawns_DayZSA_Part1[randSpawn][0],randomSpawns_DayZSA_Part1[randSpawn][1],randomSpawns_DayZSA_Part1[randSpawn][2]); 
To this
PHP код:
          new randSpawn random(sizeof(randomSpawns_DayZSA_Part1));
            
SetSpawnInfo(playerid,randomSpawns_DayZSA_Part1[randSpawn][0],randomSpawns_DayZSA_Part1[randSpawn][1],randomSpawns_DayZSA_Part1[randSpawn][2]); 



Re: Wrong Coordonates? - Flake. - 20.07.2016

Quote:
Originally Posted by FuNkYTheGreat
Посмотреть сообщение
change this
PHP код:
          new randSpawn random(sizeof(randomSpawns_DayZSA_Part1));
            
SetPlayerPos_Allow(playerid,randomSpawns_DayZSA_Part1[randSpawn][0],randomSpawns_DayZSA_Part1[randSpawn][1],randomSpawns_DayZSA_Part1[randSpawn][2]); 
To this
PHP код:
          new randSpawn random(sizeof(randomSpawns_DayZSA_Part1));
            
SetSpawnInfo(playerid,randomSpawns_DayZSA_Part1[randSpawn][0],randomSpawns_DayZSA_Part1[randSpawn][1],randomSpawns_DayZSA_Part1[randSpawn][2]); 
If you're going to be using setspawninfo make sure you're Spawning the player straight after this is set with
PHP код:
SpawnPlayer(playerid); 
If you're trying to spawn the player first you'll spawn at blueberry


Re: Wrong Coordonates? - Zeus666 - 20.07.2016

If you're trying to spawn the player first you'll spawn at blueberry[/QUOTE]



And how to set it?



PHP код:
 warning 213tag mismatch
 
warning 213tag mismatch
 
warning 202number of arguments does not match definition
 
warning 202number of arguments does not match definition
 
warning 202number of arguments does not match definition
 
warning 202number of arguments does not match definition
 
warning 202number of arguments does not match definition
 
warning 202number of arguments does not match definition
 
warning 202number of arguments does not match definition
 
warning 202number of arguments does not match definition
 
warning 202number of arguments does not match definition 



Re: Wrong Coordonates? - Flake. - 20.07.2016

It should be
PHP код:
SetSpawnInfoplayerid00randomSpawns_DayZSA_Part1[randSpawn][0],randomSpawns_DayZSA_Part1[randSpawn][1],randomSpawns_DayZSA_Part1[randSpawn][2], 000000);
SpawnPlayer(playerid); 
More information here: https://sampwiki.blast.hk/wiki/SetSpawnInfo


Re: Wrong Coordonates? - Zeus666 - 20.07.2016

Float, Float:y, Float:z,


But at my Float:randomSpawns_DayZSA_Part1[4][4] = i already have 4 XYZ coordonates.

and skin i need to edit, right?


Re: Wrong Coordonates? - Flake. - 20.07.2016

Quote:
Originally Posted by Zeus666
Посмотреть сообщение
Float, Float:y, Float:z,


But at my Float:randomSpawns_DayZSA_Part1[4][4] = i already have 4 XYZ coordonates.

and skin i need to edit, right?
PHP код:
SetSpawnInfoplayerid0/*Skin id here*/randomSpawns_DayZSA_Part1[randSpawn][0],randomSpawns_DayZSA_Part1[randSpawn][1],randomSpawns_DayZSA_Part1[randSpawn][2], randomSpawns_DayZSA_Part1[randSpawn][3], 00000); 



Re: Wrong Coordonates? - Zeus666 - 20.07.2016

Thanks, but now it's worse.

http://i.imgur.com/4l9BEw5.png


It won't spawn me at all.

At first it shows me partially my "randomspawn" coords but fastly spawns me at blueberry


it's like it spawns me twice, i think

http://i.imgur.com/ar8ZXXb.jpg

see?


PHP код:
function SetPlayerPos_Allow(playeridFloat:px_abFloat:py_abFloat:pz_ab)
{
    
abAllow[playerid] = 1;
    
defer ResetAB_Allow(playerid);
    
SetPlayerPos(playeridpx_abpy_abpz_ab);
    return 
1;