Can't enter PD as passanger and non PD
#1

When i want to enter the PD vehicle, it automatically doesn't let it.
Admins can but normal players can't.

I want that everyone can enter a PD vehicle, unless locked ofc.

Is there something in these lines preventing it?

Thx in Advance
PHP код:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    new 
string[128];
    if(
VehicleLocked[vehicleid])
    {
        new 
Float:playerposxFloat:playerposyFloat:playerposz;
        
GetPlayerPos(playeridplayerposxplayerposyplayerposz);
        if(
PlayerInfo[playerid][pAdmin] == 0)
        {
            
SetPlayerPos(playerid,playerposxplayerposyplayerposz);
        }
        
SendClientMessage(playerid,COLOR_WHITE,"[VEHICLE:] Vehicle Locked.");
    }
     if(
DynamicCars[vehicleid-1][CarType] == 1)
    {
        if(
TakingDrivingTest[playerid] != 1)
        {
            new 
Float:playerposxFloat:playerposyFloat:playerposz;
            
GetPlayerPos(playeridplayerposxplayerposyplayerposz);
            if(
PlayerInfo[playerid][pAdmin] == 0)
            {
                   
SetPlayerPos(playerid,playerposxplayerposyplayerposz);
            }
            
SendClientMessage(playerid,COLOR_WHITE,"[ERROR:] Your not taking your driving test!");
        }
    }
     if(
DynamicCars[vehicleid-1][FactionCar] != 255)
    {
        if(
DynamicFactions[DynamicCars[vehicleid-1][FactionCar]][fType] == 1)
        {
            if(
PlayerInfo[playerid][pFaction] != DynamicCars[vehicleid-1][FactionCar])
            {
                new 
Float:playerposxFloat:playerposyFloat:playerposz;
                
GetPlayerPos(playeridplayerposxplayerposyplayerposz);
                if(
PlayerInfo[playerid][pAdmin] == 0)
                {
                    
SetPlayerPos(playerid,playerposxplayerposyplayerposz);
                }
                
format(stringsizeof(string), "[LSPD:] %s has been spotted attempting to steal a police vehicle."GetPlayerNameEx(playerid));
                
SendFactionTypeMessage(1,COLOR_LSPD,string);
                new 
location[MAX_ZONE_NAME];
                
GetPlayer2DZone(playeridlocationMAX_ZONE_NAME);
                
format(stringsizeof(string), "[LSPD:] All units be on the lookout for %s - Person Last Seen: %s."GetPlayerNameEx(playerid),location);
                
SendClientMessage(playerid,COLOR_LIGHTYELLOW2,"[VEHICLE:] You have been spotted attempting to steal a police vehicle!");
            }
        }
        
format(stringsizeof(string), "[FACTION:] This vehicle belongs to %s.",DynamicFactions[DynamicCars[vehicleid-1][FactionCar]][fName]);
        
SendClientMessage(playerid,COLOR_WHITEstring);
    } 
Reply
#2

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new string[128];
    if(VehicleLocked[vehicleid])
    {
        new Float:playerposx, Float:playerposy, Float:playerposz;
        GetPlayerPos(playerid, playerposx, playerposy, playerposz);
        if(PlayerInfo[playerid][pAdmin] == 0)
        {
            SetPlayerPos(playerid,playerposx, playerposy, playerposz);
        }
        SendClientMessage(playerid,COLOR_WHITE,"[VEHICLE:] Vehicle Locked.");
    }
     if(DynamicCars[vehicleid-1][CarType] == 1)
    {
        if(TakingDrivingTest[playerid] != 1)
        {
            new Float:playerposx, Float:playerposy, Float:playerposz;
            GetPlayerPos(playerid, playerposx, playerposy, playerposz);
            if(PlayerInfo[playerid][pAdmin] == 0)
            {
                   SetPlayerPos(playerid,playerposx, playerposy, playerposz);
            }
            SendClientMessage(playerid,COLOR_WHITE,"[ERROR:] Your not taking your driving test!");
        }
    }
     if(DynamicCars[vehicleid-1][FactionCar] != 255)
    {
        if(DynamicFactions[DynamicCars[vehicleid-1][FactionCar]][fType] == 1)
        {
            if(PlayerInfo[playerid][pFaction] != DynamicCars[vehicleid-1][FactionCar])
            {
                format(string, sizeof(string), "[LSPD:] %s has been spotted attempting to steal a police vehicle.", GetPlayerNameEx(playerid));
                SendFactionTypeMessage(1,COLOR_LSPD,string);
                new location[MAX_ZONE_NAME];
                GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
                format(string, sizeof(string), "[LSPD:] All units be on the lookout for %s - Person Last Seen: %s.", GetPlayerNameEx(playerid),location);
                SendClientMessage(playerid,COLOR_LIGHTYELLOW2,"[VEHICLE:] You have been spotted attempting to steal a police vehicle!");
            }
        }
        format(string, sizeof(string), "[FACTION:] This vehicle belongs to %s.",DynamicFactions[DynamicCars[vehicleid-1][FactionCar]][fName]);
        SendClientMessage(playerid,COLOR_WHITE, string);
    }
Reply
#3

WORKS,

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)