SA-MP Forums Archive
Load selected player class - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Load selected player class (/showthread.php?tid=248050)



Load selected player class - JackYack13 - 11.04.2011

I have some code which saves into a file which player class the player chose in the class selection. But now I would like to make it so that when the player enters the server again, the class which they used before will be selected right away so that they don't have to look for it among 200 other classes. Any help on how I could do this?


Re: Load selected player class - Cameltoe - 11.04.2011

Try to call OnPlayerRequestClass with the class variable from your file.

pawn Код:
OnPlayerRequestClass(playerid, dini_Int(file,"Class"));



Re: Load selected player class - JackYack13 - 11.04.2011

Didn't work Any other ideas?


Re: Load selected player class - marinov - 11.04.2011

work with dini and Spawn(playerid) (make it skip class selection)


Re: Load selected player class - Retardedwolf - 11.04.2011

SetPlayerClass ?


Re: Load selected player class - Joe Staff - 11.04.2011

Unless weapons/ammo loadout is specified when using AddPlayerClass(...), then the only difference in classes is the Skin ID, just load that...


Re: Load selected player class - JackYack13 - 12.04.2011

Quote:
Originally Posted by Retardedwolf
Посмотреть сообщение
SetPlayerClass ?
I don't have this.
Quote:
Originally Posted by SilentHuntR
Посмотреть сообщение
Unless weapons/ammo loadout is specified when using AddPlayerClass(...), then the only difference in classes is the Skin ID, just load that...
Could you show me a code example?


Re: Load selected player class - JackYack13 - 12.04.2011

Nvm, I did this another way.. But now I have another problem:
https://sampforum.blast.hk/showthread.php?pid=1162105#pid1162105
Would you bother checking?