[ERROR] Spawn at the center of the map...
#1

Hello, I created a nice tutorial system that sometimes makes me whims, and not spawn in the exact spot (airport), the gameplay is roleplay and the script is a little put at random.

Код:
		if(PlayerInfo[playerid][pRegistered] == 0)
		        
                        {
                        TogglePlayerControllable(playerid,1);
			PlayerInfo[playerid][pLevel] = 1;
			PlayerInfo[playerid][pBank] = 0;
			PlayerInfo[playerid][pSkin] = 29;
			PlayerInfo[playerid][pCash] = 0;
			gPlayerLogged[playerid] = 1;
                        SetPlayerPos(playerid,-1828.8499,18.3889,1061.1436);
	                SetPlayerInterior(playerid, 14);
	                SetPlayerVirtualWorld(playerid, 0);
	                SpawnPlayer(playerid);
	                SpawnAereoporto[playerid] = 1;
			SetPlayerCash(playerid,PlayerInfo[playerid][pCash]);
		        ShowPlayerDialog(playerid,19,DIALOG_STYLE_INPUT,"Etа","Quanti anni vuoi avere? Digita un etа tra                                        1 a 100 anni","Avanti","Annulla");
		        PlayerPlaySound(playerid, 1069, 0.0, 0.0, 0.0);
			      }
Thank's a lot!
Reply
#2

Use SetSpawnInfo
Reply
#3

Yes, SetPlayerPos() is poor for this kind of thing, use SetSpawnInfo()
Reply
#4

Thanks, I tried but always spawn in the center of the map
Reply
#5

SetSpawnInfo before SpawnPlayer
Reply
#6

Not working... spawn in the center of the map....... I only work rotation!!

Код:
		if(PlayerInfo[playerid][pRegistered] == 0)
		{
                SetSpawnInfo(playerid, 0, 29,-1828.84,18.38,1061.14,269.15,0,0,0,0,0,0);
	        SetPlayerInterior(playerid, 14);
                SetPlayerVirtualWorld(playerid, 0);
                SpawnPlayer(playerid);
                TogglePlayerControllable(playerid,1);
		PlayerInfo[playerid][pLevel] = 1;
	        PlayerInfo[playerid][pBank] = 0;
		PlayerInfo[playerid][pSkin] = 29;
		PlayerInfo[playerid][pCash] = 0;
		gPlayerLogged[playerid] = 1;
		SpawnAereoporto[playerid] = 1;
		SetPlayerCash(playerid,PlayerInfo[playerid][pCash]);
		ShowPlayerDialog(playerid,19,DIALOG_STYLE_INPUT,"Age","How many years have you?","Next","Cancel");
		PlayerPlaySound(playerid, 1069, 0.0, 0.0, 0.0);
			      }
Reply
#7

UP.... I'm hopeless
Reply
#8

UP.... I'm hopeless
Reply
#9

Wait, it doesn't make any sense..

pawn Код:
SetPlayerPos(playerid,-1828.8499,18.3889,1061.1436);
SetPlayerInterior(playerid, 14);
SetPlayerVirtualWorld(playerid, 0);
SpawnPlayer(playerid);
You're setting player some position and then you want to spawn him again... so that means a double-spawn, why? However, you said that you wan't to spawn player on the airport, is it outside or inside somewhere? cause I see interior is different than 0, just a security question.

pawn Код:
SetSpawnInfo(playerid, 0, 29,-1828.84,18.38,1061.14,269.15,0,0,0,0,0,0);
Move it to the OnPlayerRequestClass callback or try OnPlayerConnect (not sure is Connecting gonna make it).
Reply
#10

If you want your script to work just put SetPlayerPos after SpawnPlayer(), but otherwise use SetSpawnInfo instead. Just answering your original question.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)