Car Problem
#1

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?
Reply
#2

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.");
    }
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)