SA-MP Forums Archive
skin selection - 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: skin selection (/showthread.php?tid=347622)



skin selection - TheDiscussionCafe - 02.06.2012

hi. i want to make skin save so when player register they can pick class and when player re-login after he quit, he can go to skin selection screen and the first skin will be the skin he had before/when he register.

i have Onplayerspawn:
pawn Код:
SetPlayerSkin(playerid,dUserINT(PlayerName(playerid)).("Skin"));
i have this on Onplayerdisconnect:
pawn Код:
new skinid = GetPlayerSkin(playerid);
dUserSetINT(PlayerName(playerid)).("Skin",skinid);
am i doing wrong? and now how i am supposed to do?


Re: skin selection - TheDiscussionCafe - 02.06.2012

Quote:
Originally Posted by n00b_scripter
Посмотреть сообщение
well you just need to add
OnPlayerRequestClass();
or a thing like this in OnPlayerResponce inside the responce of your register command
+
you new thing
add the 1st class in your gamemode this
AddPlayerClass((PlayerInfo[playerid][pskin]),X,Y,Z);
you need to udjest it as you wana do it
wait what you mean?


Re: skin selection - Niko_boy - 02.06.2012

Wrong is that playerid will be differnt if another player join
[e.g. if pID = current player he left his id was 1 and beofre he rejoin another player join with id 1 then it will be useless , so this is worn methos of saving temporary informations / data / vars
so u cant use (playerid) in variables of OnPlayerDisconnect


Re: skin selection - TheDiscussionCafe - 02.06.2012

Quote:
Originally Posted by Niko_boy
Посмотреть сообщение
Wrong is that playerid will be differnt if another player join
[e.g. if pID = current player he left his id was 1 and beofre he rejoin another player join with id 1 then it will be useless , so this is worn methos of saving temporary informations / data / vars
so u cant use (playerid) in variables of OnPlayerDisconnect
okay i see. then i how i would do it?


Re: skin selection - Niko_boy - 02.06.2012

actualy i too tried making a system too save temporary variables once but was failed
it was like this -> ( i might be wrong , just see if u get some idea )
1. you should get name of player when he disconnect and store it somewhere and assign a costant ID to it (assigning id part was failing in my script )
2. when reconnects re-compare/ match variables / names and IDs and create some stocks that has a main functioning etc...

as i said i really not sure


Re: skin selection - TheDiscussionCafe - 02.06.2012

hmm i still dont get

i really need help