Skin selection problem
#1

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 ...
Reply
#2

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
Reply
#3

not working
Reply
#4

it should work.... return 0 OnPlayerRequestSpawn will not spawn them...
Reply
#5

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
Reply
#6

Up !!
Reply
#7

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)