SA-MP Forums Archive
Player spawn at wrong place - 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: Player spawn at wrong place (/showthread.php?tid=407158)



Player spawn at wrong place - NiceWizard - 12.01.2013

Hello ,

In my gamemode I have 2 classes , 1 class spawn somewhere , the second I added it's looked similar to that one :
AddPlayerClass( 0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );, and when I respawn a new class it's repsawn me in the same place as the first class and yes I have different co-ordination I'm now any help ?


Re: Player spawn at wrong place - Antonioh - 12.01.2013

Add me in skype and i will help you with teamviewer
Sorry my english bad


Re: Player spawn at wrong place - NiceWizard - 12.01.2013

Anyone have resolution ??


Re: Player spawn at wrong place - NiceWizard - 13.01.2013

Bump

Any help ?


Re: Player spawn at wrong place - RajatPawar - 13.01.2013

Can you give the whole code of where you add classes and where/how you spawn them?


Re: Player spawn at wrong place - NiceWizard - 13.01.2013

OK

This is my first class :

Quote:

AddPlayerClass(280, 1310.1509, -1367.6149 ,13.5383 ,179.3588, 0, 0, 0, 0, 0, 0);

And the second one which I want to spawn in different location :

Quote:

AddPlayerClass(0, 2530.2471, -1698.7323 ,13.4976 ,240.3018, 16, 5, 28, 140, 23, 30);

And on spawn code I have that :

Quote:

public OnPlayerSpawn(playerid)
{
SetPlayerPos (playerid, 1310.1509,-1367.6149,13.5383);
SetPlayerHealth (playerid, 100);
SetPlayerArmour (playerid, 100);
new PlayerName[MAX_PLAYER_NAME],
string[128];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "%s has spawned.", PlayerName);
SendClientMessageToAll(0xFFFFFFFF, string);
return 1;
}

On spawn code I notice there is same location as the first class so maybe that cause the problem with location


Re: Player spawn at wrong place - RajatPawar - 13.01.2013

Yeah, that's the problem. Because you specifically MENTIONED to spawn in the co-ordinates. You could get the classid, like if(classid = 0), SetPlayerPos(playerid, Spawn here.), else .... The other co-ordinates.


Re: Player spawn at wrong place - NiceWizard - 13.01.2013

I don't understand a litter bit about classid and when I SetPlayerPos to different location It will still respawn me in same place but I want to respawn different character at different place :/

Put :

if(classid = 0), SetPlayerPos(playerid, 2530.2471, -1698.7323 ,13.4976.);
Instead of SetPlayerPos and get errors


Re: Player spawn at wrong place - NiceWizard - 13.01.2013

Any Idea ?


Re: Player spawn at wrong place - Mr.Faqahat - 13.01.2013

Are you using RandomSpawn ? i mean one team spawn at different positions ?