skin 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: skin problem (
/showthread.php?tid=67881)
skin problem -
CJ101 - 05.03.2009
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);
}
}
Re: skin problem -
Outbreak - 05.03.2009
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.