OnPlayerEnterVehicle Problem
#1

i made a thing so when a player tries to enter a locked car alarm too go on and message appear..but i get message when the car is unlocked and alarm goes on when car is unlocked..


PHP код:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
                    {
                    new 
plname[MAX_PLAYER_NAME];
                    
GetPlayerName(playeridplnamesizeof(plname));
                    new 
string[128];
                    new 
vehicle[24];
                    new 
enginelightsalarmdoorsbonnetbootobjective;
                    
GetVehicleName(vehicleidvehiclesizeof(vehicle));
                     if(
IsAnOwnableCar(vehicleid) && CarInfo[vehicleid][cLock] == && CarInfo[vehicleid][cOwned] == 1)
                    {
                        if(
IsPlayerAdmin(playerid))
                        {}
                        else if(
PlayerInfo[playerid][pMember] == 15 && PlayerToPoint(80playerid, -85.1367,271.1868,8.2266) || PlayerToPoint(80playerid, -107.7662,279.9160,8.2266) || PlayerToPoint(80playerid, -75.1942,292.4110,8.2266) || PlayerToPoint(80playerid, -62.4625,296.0438,8.2266) || PlayerToPoint(80playerid, -33.0083,339.7525,8.7315) || PlayerToPoint(80playerid, -22.0927,370.2774,9.0525)) { }
                        else
                        {
                            new 
Float:cxFloat:cyFloat:cz;
                            
GetPlayerPos(playeridcxcycz);
                            
SetPlayerPos(playeridcxcycz);
                        }
                    }
                    if(
IsAnOwnableCar(vehicleid))
                    {
                        if(
CarInfo[vehicleid][cOwned] == 1)
                        {
                            
format(string,sizeof(string),"Intri in masina %s (%d)  Proprietar: %s",vehicle,vehicleid,CarInfo[vehicleid][cOwner]);//this
                            
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                        }
                    }
                    if(
IsAnOwnableCar(vehicleid))
                    {
                          if(
CarInfo[vehicleid][cOwned] == || CarInfo[vehicleid][cLock] == 1)// cOwner = 1 cLock = 1... so basically if the car is locked then alarm - 0
                        
{
                            
SendClientMessage(playeridCOLOR_RED"This Vehicle is Closed");//this message and alarm..
                            
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                            
SetVehicleParamsEx(vehicleid,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
                            
SetPVarInt(playerid"Alarm"1);
                          }
                    }
                    if(
IsAnOwnableCar(vehicleid))
                    {
                        if(
CarInfo[vehicleid][cOwned] == 0)
                        {
                            
format(string,sizeof(string),"Intri in masina %s (%d)  Proprietar: Dealership",vehiclevehicleid);
                            
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                        }
                    }
                    else
                    {
                    if(
IsACopCar(vehicleid))
                    {
                    
format(string,sizeof(string),"Intri in masina %s (%d)   Proprietar: SAPD",vehiclevehicleid);
                    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    }
//this good?
                    
else if(IsAFbiCar(vehicleid))
                    {
                    
format(string,sizeof(string),"Intri in masina %s (%d)   Proprietar: FBI",vehiclevehicleid);
                    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    }
                    else if(
IsARentCar(vehicleid))
                    {
                    
format(string,sizeof(string),"Intri in masina %s (%d)   Proprietar: Rent",vehiclevehicleid);
                    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    }
                    else if(
IsATowCar(vehicleid))
                    {
                    
format(string,sizeof(string),"Intri in masina %s (%d)   Proprietar: Tow Company",vehiclevehicleid);
                    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    }
                    else if(
IsATaxiCar(vehicleid))
                    {
                    
format(string,sizeof(string),"Intri in masina %s (%d)   Proprietar: Taxi Company",vehiclevehicleid);
                    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    }
                    else if(
IsATigaCar(vehicleid))
                    {
                    
format(string,sizeof(string),"Intri in masina %s (%d)   Proprietar: La Tigani",vehiclevehicleid);
                    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    }
                    else if(
IsAGlenCar(vehicleid))
                    {
                    
format(string,sizeof(string),"Intri in masina %s (%d)   Proprietar: The Ballas Gang",vehiclevehicleid);
                    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    }
                    else if(
IsANgCar(vehicleid))
                    {
                    
format(string,sizeof(string),"Intri in masina %s (%d)   Proprietar: National Guard",vehiclevehicleid);
                    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    }
                    else if(
IsAGovernmentCar(vehicleid))
                    {
                    
format(string,sizeof(string),"Intri in masina %s (%d)   Proprietar: Primaria",vehiclevehicleid);
                    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    }
                    else if(
IsAFireCar(vehicleid))
                    {
                    
format(string,sizeof(string),"Intri in masina %s (%d)   Proprietar: Los Aztecas Gang",vehiclevehicleid);
                    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    }
                    else if(
IsAAmbulanceCar(vehicleid))
                    {
                    
format(string,sizeof(string),"Intri in masina %s (%d)   Proprietar: S.M.U.R.D",vehiclevehicleid);
                    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    }
                    else if(
IsANrCar(vehicleid))
                    {
                    
format(string,sizeof(string),"Intri in masina %s (%d)   Proprietar: News Reporter",vehiclevehicleid);
                    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    }
                    else if(
IsAYepCar(vehicleid))
                    {
                    
format(string,sizeof(string),"Intri in masina %s (%d)   Proprietar: The Yakuza",vehiclevehicleid);
                    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    }
                    else if(
IsANapCar(vehicleid))
                    {
                    
format(string,sizeof(string),"Intri in masina %s (%d)   Proprietar: La Cosa Nostra",vehiclevehicleid);
                    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    }
                    else if(
IsAMafiaCar(vehicleid))
                    {
                    
format(string,sizeof(string),"Intri in masina %s (%d)   Proprietar: The Triads",vehiclevehicleid);
                    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    }
                    else if(
IsACimentCar(vehicleid))
                    {
                    
format(string,sizeof(string),"Intri in masina %s (%d)   Proprietar: Transport Pietre",vehiclevehicleid);
                    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    }
                    else if(
IsAFunerarCar(vehicleid))
                    {
                    
format(string,sizeof(string),"Intri in masina %s (%d)   Proprietar: Pompe Funebre",vehiclevehicleid);
                    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    }
                    else if(
IsABereCar(vehicleid))
                    {
                    
format(string,sizeof(string),"Intri in masina %s (%d)   Proprietar: Distribuitor",vehiclevehicleid);
                    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    }
                    else if(
IsACurierCar(vehicleid))
                    {
                    
format(string,sizeof(string),"Intri in masina %s (%d)   Proprietar: Curier Rapid",vehiclevehicleid);
                    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    }
                    else if(
IsAGustaCar(vehicleid))
                    {
                    
format(string,sizeof(string),"Intri in masina %s (%d)   Proprietar: Los Vagos Gang",vehiclevehicleid);
                    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    }
                    else if(
IsATruck(vehicleid))
                    {
                    
format(string,sizeof(string),"Intri in masina %s (%d)   Proprietar: Trucker",vehiclevehicleid);
                    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    }
                    else if(
IsAMSCar(vehicleid))
                    {
                    
format(string,sizeof(string),"Intri in masina %s (%d)   Proprietar: Grove Street Gang",vehiclevehicleid);
                    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    }
                    }
                    } 
Reply
#2

PHP код:
 if(IsAnOwnableCar(vehicleid))
                    {
                        if(
CarInfo[vehicleid][cOwned] == || CarInfo[vehicleid][cLock] == 1)// cOwner = 1 cLock = 1... so basically if the car is locked then alarm - 0
                        
{
                            
SendClientMessage(playeridCOLOR_RED"This Vehicle is Closed");//this message and alarm..
                            
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                            
SetVehicleParamsEx(vehicleid,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
                            
SetPVarInt(playerid"Alarm"1);
                        }
                        if(
CarInfo[vehicleid][cOwned] == 0)
                        {
                            
format(string,sizeof(string),"Intri in masina %s (%d)  Proprietar: Dealership",vehiclevehicleid);
                            
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                        }
                    }
                    else..............
Other
Reply
#3

still same..
Reply
#4

nobody??
Reply
#5

Put a lock cmd... pls
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)