Help in OnplayerRequestclass - 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 in OnplayerRequestclass (
/showthread.php?tid=527236)
Help in OnplayerRequestclass -
AroseKhanNiazi - 21.07.2014
well how can i do that if player has an saved skin it will only show that skin for class selection and when he registers he can see all the skins for choosing first time
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid,513.0550,-15.1650,1001.5653);
SetPlayerCameraPos(playerid, 513.1265, -12.1960, 1001.7545);
SetPlayerCameraLookAt(playerid, 513.0715, -13.1931, 1001.8734);
SetPlayerFacingAngle( playerid, 359.1068);
SetPlayerInterior(playerid, 3);
if(!pInfo[playerid][LoggedInAsPlayer])
{
LoginOrRgisteryBox(playerid);
}
if(pInfo[playerid][newlife] || pInfo[playerid][Savedskin] == INVALID_SKIN_ID)
{
switch(classid)
{
case 0..274: GameTextForPlayer(playerid,SkinNames[classid], 3000, 5);
}
}
AddPlayerClass(pInfo[playerid][Savedskin],1523.8240,-43.7732,1002.1310,180.0000,0,0,0,0,0,0); //
if(pInfo[playerid][Savedskin] != INVALID_SKIN_ID)
{
classid =275;
}
return 1;
}
i tried this it was no use
INVALID_SKIN_ID = 350
Re: Help in OnplayerRequestclass -
ikkentim - 21.07.2014
You can't tell which classes are shown for which players. All classes you add (AddPlayerClass(...)) are shown for every player in the class selection.
it it best if you only add classes in OnGameModeInit or OnFilterScriptInit.
You can however force a player to wear a certain skin. when the player goes into the class selection menu and the player has a saved skin, use SetSpawnInfo and then SpawnPlayer
https://sampwiki.blast.hk/wiki/SetSpawnInfo
https://sampwiki.blast.hk/wiki/SpawnPlayer
Re: Help in OnplayerRequestclass -
ikkentim - 21.07.2014
Quote:
Originally Posted by ******
That's not true - use y_classes and you can adjust all skins for any player.
|
Today I learned something new, never knew it was possible
Re: Help in OnplayerRequestclass -
AroseKhanNiazi - 21.07.2014
Quote:
Originally Posted by ******
That's not true - use y_classes and you can adjust all skins for any player.
|
thanks i will do it
Re : Help in OnplayerRequestclass -
ManuelNeuer - 21.07.2014
I just tested it and it worked, So simple as it is, If a player is new after the Dialog of register you show him the list of skins, And when he do login, You will give him the possiblity of only one skin.