OnPlayerEnterVehicle Bug - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerEnterVehicle Bug (
/showthread.php?tid=599964)
OnPlayerEnterVehicle Bug -
danielpalade - 01.02.2016
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.
Re: OnPlayerEnterVehicle Bug -
danielpalade - 01.02.2016
Bumping! Really need this done!
Re: OnPlayerEnterVehicle Bug -
[eLg]elite - 01.02.2016
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.
Re: OnPlayerEnterVehicle Bug -
-CaRRoT - 01.02.2016
Код:
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)
Re: OnPlayerEnterVehicle Bug -
KillerDVX - 01.02.2016
PHP код:
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;
}
return 1;
}