[HELP] Forbid players using certain skins
#1

Hello ya'all.

I'm trying to make a script that stops a player from spawning if he don't got PlayerInfo[playerid][pCopRights] == 1.
And I want this thing to be on OnPlayerRequestSpawn, it should work like this login system:

Код:
    if(gPlayerLogged[playerid] == 0)
	{
		SendClientMessage(playerid, COLOR_LIGHT_RED,"You must login to your account before you can spawn.");
 		return 0;
	}
But when a player tried to select a Cop skin, he should see a message like this and should not be able to use the cop skins if he don't got Cop Rights.

Thanks
Reply
#2

if(GetPlayerSkin(playerid) == copskin && copskin2 && copskin3)
{
SetPlayerHealth(playerid,0);
}

work with that
Reply
#3

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(PlayerInfo[playerid][pCopRights] != 1)
    {
        if(GetPlayerSkin(playerid) == [Your Id Skin Here])
        {
            SendClientMessage(playerid, SOME_COLOR, "You Need To Be A Cop bla bla..);
            return 0;
        }
    }
    return 1;
}
Ain't sure if it will work since it isn't tested, but i found a function like this in my script. And i can't compile that since i don't have PlayerInfo and such.
Reply
#4

Yes, using this code in OnPlayerRequestSpawn, will work perfectly, is the best way.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)