skin problem
#1

ok in my server its supposed to do things for only specific skins, but does it for all skins anyway. Whats wrong?

Код:
if (GetPlayerSkin(playerid) == 287 || 163 || 282 || 255 || 165)
{
SendClientMessage(playerid,COLOR_BLUE,"[!] As a COP, your job is to take out criminals.");
}
it also does it here:
Код:
new vehid;
vehid = GetVehicleModel(vehicleid);
if(vehid == 597)
{
	if (GetPlayerSkin(playerid) == 287 || 163 || 282 || 255 || 165)
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "== You can use this vehicle to do your job.");
	}
	else
	{
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "== You are not a cop.");
	RemovePlayerFromVehicle(playerid);
	}
}
Reply
#2

This should help you, I've made it so no player can enter as driver or passenger, if you want to change that just remove the "|| newstate == PLAYER_STATE_PASSENGER" part.

pawn Код:
new plvehid;
    plvehid = GetVehicleModel(GetPlayerVehicleID(playerid));
    new skin = GetPlayerSkin(playerid);
    if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
    {
        if(plvehid == 597)
        {
            if( (skin == 287) || (skin == 163) || (skin == 282) || (skin == 255) || (skin == 165))
            {
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "== You can use this vehicle to do your job.");
            }
            else
            {
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "== You are not a cop.");
                RemovePlayerFromVehicle(playerid);
            }
        }
    }
Place it under public OnPlayerStateChange(playerid,newstate,oldstate)

If you place it under OnPlayerEnterVehicle it will only be called when the player pressed ENTER, at that time they aren't yet in the vehicle, so they can't be ejected from it.

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)