Car entering block by skin number - 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: Car entering block by skin number (
/showthread.php?tid=73000)
Car entering block by skin number -
Moso - 12.04.2009
How could I make system: People who got example LVPD Officer Skin, Can only enter police vehicles?
Re: Car entering block by skin number -
Think - 12.04.2009
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if (newstate == PLAYER_STATE_PASSENGER || newstate == PLAYER_STATE_DRIVER)
{
new vehid = GetVehicleModel(GetPlayerVehicleID(playerid));
if(vehid == /*Put the police vehicle shit here*/)
{
if(GetPlayerSkin(playerid) == /*Put the skin number here*/)
{
RemovePlayerFromVehicle(playerid);
}
}
}
return 1;
}
guess this is it
Re: Car entering block by skin number -
Khelif - 12.04.2009
this is my simple idea...
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(GetPlayerSkin(playerid) != 1 && GetVehicleModel(vehicleid) == 1) //Change id's. If the player isn't cop, he will be removed from vehicle
RemovePlayerFromVehicle(playerid);
}
return 1;
}
Re: Car entering block by skin number -
Moso - 12.04.2009
Thank you
Re: Car entering block by skin number -
Weirdosport - 12.04.2009
OnPlayerEnterVehicle would be the best callback to use, as it changes when the player presses F. OnPlayerStateChange only changes to Player_state_driver when the player is fully in the car and ready to go..