Car 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: Car Problem (
/showthread.php?tid=109869)
Car Problem -
mbk - 22.11.2009
Hy..i have a problem with cars....i add a new car police but every player could get in.
Код:
AddStaticVehicle(523,1587.3083,-1608.9404,12.9253,0.0527,89,1); //Moto 1
Код:
public IsACopCar(carid)
{
if((carid >= 35) && (carid <= 60) || carid == 66 || carid == 67 || carid == 91 || carid == 92 || carid == 93 || carid == 36 || carid == 208 )
{
if(carid == 45 || carid == 46 || carid == 55 || carid == 59 )
return 1;
}
return 0;
What is problem?
Re: Car Problem -
Striker_Moe - 22.11.2009
Okay Iґll show you how to do this.
This is from my own gamemode, working fine:
pawn Код:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER)
{
if(GetVehicleModel(vehicleid) == 495) // CHANGE THIS to the vehicle ID of the cop car
{
if(cop[playerid] == 1) // CHANGE THIS to your define of cop
{
SendClientMessage(playerid,NICESKY,"Welcome to your car, officer!");
}
else
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,RED,"This car is for law enforcers only.");
}
}
}