Get information before spawn? - 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: Get information before spawn? (
/showthread.php?tid=142631)
Get information before spawn? -
falor - 19.04.2010
Hey guys,
I wonder if we can get a information into the playerfile into the OnGamemodeinit, before spawning.
I did :
Код:
new idskin = PlayerInfo[playerid][skin];
AddPlayerClass(idskin,1552.5618,-1675.3375,16.1953,269.1425,0,0,0,300,-1,-1);
But, playerid isn't defined.
Any ideas?
Re: Get information before spawn? -
Simon - 19.04.2010
pawn Код:
public OnPlayerConnect(playerid)
{
// Get player data here and save it to PlayerInfo[playerid][skin]
}
public OnPlayerSpawn(playerid)
{
SetPlayerSkin(PlayerInfo[playerid][skin]);
return 1;
}
Re: Get information before spawn? -
falor - 19.04.2010
Thanks, but it's not what i'm searching for.
I want to change the skin chooser in function of playerskin.
( a cop will have for exemple a cop displayed and a civil his skin)
Re: Get information before spawn? -
Simon - 19.04.2010
I see, the only way I know how to do that would be to make a custom class selection. Make 3 fake AddPlayerClasses, then you can use SetPlayerSkin + SetSpawnInfo on the player when they're in class selection using OnPlayerRequestClass (the 3 classes are for detecting left, right using the classid in this callback). I hope this helps somewhat

.
Re: Get information before spawn? -
falor - 19.04.2010
Okay, i will try, thank you buddy