SA-MP Forums Archive
Help with loading / saving system. - 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: Help with loading / saving system. (/showthread.php?tid=530414)



Help with loading / saving system. - zConroy - 07.08.2014

Hello,

I'm a beginner scripter, I followed Kush's login/account system, and I'm trying to add in a system to skip the class selection screen and just spawn in the player after he/she registered or logged in, and have their skin set to what it was previously, or if they're just registering, set to a default skin.

I have no clue how to skip to skin selector screen even after googling it
Code:
 spawnplayer(playerid)
does not seem to work and when I did get it to work it spawned me out in blueberry and idk where to add in the spawn location, I do have the skin saving system set, but I can't figure out how to open up the y_ini file, get the skin ID from that and use it.

I've tried this and it doesn't work
Code:
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin])
Skip class selection screen and spawn: No clue how to do
Save skin on disconnect: Got it.
Setskin to what was saved on login: No clue how to fix it


Re: Help with loading / saving system. - IceBilizard - 07.08.2014

you need to remove
pawn Code:
public OnPlayerRequestClass(playerid, classid)
OR

pawn Code:
public SetupPlayerForClassSelection(playerid)
from your script then make a system like when player connect then show a dialog to register or login


Re: Help with loading / saving system. - zConroy - 07.08.2014

Quote:
Originally Posted by IceBilizard
View Post
you need to remove
pawn Code:
public OnPlayerRequestClass(playerid, classid)
OR

pawn Code:
public SetupPlayerForClassSelection(playerid)
from your script then make a system like when player connect then show a dialog to register or login
So I removed
pawn Code:
public OnPlayerRequestClass(playerid, classid)
and it seems like it did something, but it didn't remove the spawn button, I add in
pawn Code:
SpawnPlayer(playerid);
to after someone logs in, and it still doesn't spawn me, I'm not quite sure what to do. I still am yet to get anywhere with loading and setting the skin aswell upon spawning


Re: Help with loading / saving system. - IceBilizard - 07.08.2014

why you don't create a dialog system when player connect if not register then show dialog for register after register setplayerpos with a random location after register if player log out then save his locations with dini or y_ini functions
then if player again re-connect and registered then show login dialog and on login dialog set player position which you saved on player disconnect


Re: Help with loading / saving system. - zConroy - 07.08.2014

Quote:
Originally Posted by IceBilizard
View Post
you need to remove
pawn Code:
public OnPlayerRequestClass(playerid, classid)
OR

pawn Code:
public SetupPlayerForClassSelection(playerid)
from your script then make a system like when player connect then show a dialog to register or login
Quote:
Originally Posted by IceBilizard
View Post
why you don't create a dialog system when player connect if not register then show dialog for register after register setplayerpos with a random location after register if player log out then save his locations with dini or y_ini functions
then if player again re-connect and registered then show login dialog and on login dialog set player position which you saved on player disconnect
I already have all of that, but the player needs to be spawned for me to be able to setpos, and idk how to do that because "spawnplayer(playerid);" is not working.


Re: Help with loading / saving system. - IceBilizard - 07.08.2014

Post your script here or PM i will fix it


Re: Help with loading / saving system. - zConroy - 07.08.2014

I fixed it, I had to add in the "SetSpawnInfo" before "SpawnPlayer(playerid);"


Re: Help with loading / saving system. - IceBilizard - 07.08.2014

ok that is good enjoy