OnPlayerEnterVehicle Bug
#1

I'm trying to make it so when a player enters a vehicle and has no license, it doesn't let him.
He can only enter the vehicle if the vehicleid is equal to the vehicleid or vehicle model of a bike or faggio.
This is my code.

Код:
public OnPlayerEnterVehicle(playerid, vehicleid)
{
	new vmodel = GetVehicleModel(vehicleid);
	new Float:x, Float:y, Float:z;
	GetPlayerPos(playerid, x, y, z);
	if(pInfo[playerid][pGroup] != cInfo[vehicleid][cGroup])
	{
		SetPlayerPos(playerid, x, y, z+3);
		if(cInfo[vehicleid][cGroup] == 1)
		{
			SendClientMessage(playerid, -1, "You are not part of Los Santos Police Department.");
		}
	}
	if(pInfo[playerid][pLic1] == 0 && vmodel != 481 || vmodel != 462 || vmodel != 510 || vmodel != 509)
	{
		SetPlayerPos(playerid, x, y, z+3);
		SendClientMessage(playerid, -1, "You don't have a drivings license, a checkpoint has been set on your map.");
		SetPlayerCheckpoint(playerid, 1219.1997,-1811.9343,16.5938, 5);
	}
	return 1;
}
Simply it doesn't work, even tho I'm trying to enter a bike or the faggio it says that I don't have a license.
Reply
#2

Bumping! Really need this done!
Reply
#3

I've been getting the same type of error for a few weeks now, except I want the engine to start automatically if it's a vehicle without an engine. I'm not sure how to make it work though.
Reply
#4

Код:
if(pInfo[playerid][pLic1] == 0 && vmodel != 481 || vmodel != 462 || vmodel != 510 || vmodel != 509)
to

Код:
else if(pInfo[playerid][pLic1] == 0 && vmodel != 481 || vmodel != 462 || vmodel != 510 || vmodel != 509)
Reply
#5

PHP код:
public OnPlayerEnterVehicle(playeridvehicleid)
{
    new 
vmodel GetVehicleModel(vehicleid);
    new 
Float:xFloat:yFloat:z;
    
GetPlayerPos(playeridxyz);
    if(
pInfo[playerid][pGroup] != cInfo[vehicleid][cGroup])
    {
        
SetPlayerPos(playeridxyz+3);
        if(
cInfo[vehicleid][cGroup] == 1)
        {
            
SendClientMessage(playerid, -1"You are not part of Los Santos Police Department.");
        }
    }
    if(
pInfo[playerid][pLic1] == && vmodel != 481 || vmodel != 462 || vmodel != 510 || vmodel != 509)
    {
        
SetPlayerPos(playeridxyz+3);
        
SendClientMessage(playerid, -1"You don't have a drivings license, a checkpoint has been set on your map.");
        
SetPlayerCheckpoint(playerid1219.1997,-1811.9343,16.59385);
                return 
1;
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)