03.12.2011, 12:44
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
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(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])
{
new Float:playerposx, Float:playerposy, Float:playerposz;
GetPlayerPos(playerid, playerposx, playerposy, playerposz);
if(PlayerInfo[playerid][pAdmin] == 0)
{
SetPlayerPos(playerid,playerposx, playerposy, playerposz);
}
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);
}