Skin selection problem - 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 problem (
/showthread.php?tid=306201)
Skin selection problem -
k3nw00d_kri5ty - 25.12.2011
How i can make an skin restriction at OnPlayerRequestSpawn ?
So when i am cop and I choose a grove skin I will respawn, so I don't want this, i want to receive a simple message such as i cant spawn with this skin, i use The Godfather gamemode, Sorry for my english ...
Re: Skin selection problem -
silvan - 26.12.2011
OnPlayerRequestSpawn use the following code.
pawn Код:
if(GetPlayerSkin(...) ) // put your skins that you don't wish ppl to make.
{
if(Player.....) // put the if statement to declare the player is NOT eligible for this skin.
{
SendClientMessage(playerid,COLOR_WHITE,"You are not eligible for this skin");
return 0;
}
}
I hope this helps, + rep if it did, btw the important thing is to make return 0 where you don't want ppl to spawn under OnPlayerRequestClass
Re: Skin selection problem -
k3nw00d_kri5ty - 08.01.2012
not working
Re: Skin selection problem -
silvan - 09.01.2012
it should work.... return 0 OnPlayerRequestSpawn will not spawn them...
Re: Skin selection problem -
k3nw00d_kri5ty - 09.01.2012
i tryed this:
Код:
new clasidi;
if(clasidi == 0)
{
if(PlayerInfo[playerid][pMember] == 0)
{
PlayerInfo[playerid][pChar] = 264;
SetCameraBehindPlayer(playerid);
}
else
{
GameTextForPlayer(playerid, "You need Civilian to use this skin", 2000, 5);
return 0;
}
}
if(clasidi == 1)
{
if(PlayerInfo[playerid][pMember] == 1 && PlayerInfo[playerid][pRank] == 6)
{
PlayerInfo[playerid][pChar] = 295;
SetCameraBehindPlayer(playerid);
}
else
{
GameTextForPlayer(playerid, "You need leader Police Department to use this skin", 2000, 5);
return 0;
}
}
But not working
Re: Skin selection problem -
k3nw00d_kri5ty - 11.01.2012
Up !!
Re: Skin selection problem -
ScriptJorkis - 11.01.2012
pawn Код:
//OnPlayerRequestSpawn
new MySkin = GetPlayerSkin(playerid);
if(MySkin == 105 || 106 || 207)
{
//Place your codes here
}
Hope it clears to you now. i use just like silvan but this is different code that i made
Edit: its untested i renew it