SA-MP Forums Archive
A bit of problem with SetSpawnInfo - 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: A bit of problem with SetSpawnInfo (/showthread.php?tid=458362)



A bit of problem with SetSpawnInfo - RajatPawar - 16.08.2013

I save skins using MySQL. When the player connects, this is what goes on:

1) OnPlayerConnect, send a threaded query for checking if the player exists (OnPlayerCheckAccount)
2) OnPlayerCheckAccount, create dialogs
3) OnDialogResponse, check if the guy's pass is correct (GetPlayerPass)
4) GetPlayerPass, check if it's correct, if it is, send a query to get the data (LoadPlayerData)
5) LoadPlayerData, get data using cache functions and store in enum


What I want to do is display the chosen skin directly in the class selection. I tried setting SetSpawnInfo in LoadPlayerData, OnPlayerRequestClass, OnPlayerConnect, everything. What the problem is - when I enter the password, it shows CJ's skin or 1st skin (while I haven't added CJ's class!) and then when I click the NEXT/PREVIOUS button, it shows the correct skin (but later refuses to change - which is what is required) So, how do I make it show it the first time itself!?


Re: A bit of problem with SetSpawnInfo - RajatPawar - 17.08.2013

SOLVED. If anyone had this problem, use ForceClassSelection after you register him, but BEFORE togglePlayerSpectating(playerid, false) (which is used to hide Spawn buttons)