RemovePlayerFromVehicle not working -
Emanuel_Rodriguez - 23.07.2010
Ok, so I am trying to make it where noone can enter police vehicles, and i mean noone. so, i made this:
pawn Код:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
if(newstate == 2)
{
if(GetVehicleModel(596))
{
RemovePlayerFromVehicle(playerid);
}
if(GetVehicleModel(599))
{
RemovePlayerFromVehicle(playerid);
}
return 1;
}
return 1;
}
but it doesnt remove the player from the police car, nor the rancher! can anyone help?
Re: RemovePlayerFromVehicle not working -
Яσскѕтая - 23.07.2010
Not sure if this will work but its worth a shot.
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(GetVehicleModel(596))
{
RemovePlayerFromVehicle(playerid);
}
else if(GetVehicleModel(599))
{
RemovePlayerFromVehicle(playerid);
}
return 1;
}
Re: RemovePlayerFromVehicle not working -
Emanuel_Rodriguez - 23.07.2010
Nope. it didnt work.
Re: RemovePlayerFromVehicle not working -
Яσскѕтая - 23.07.2010
Hold up I thing I found it out.
Re: RemovePlayerFromVehicle not working -
MisterTickle - 23.07.2010
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(GetVehicleModel(vehicleid) == 596)
{
RemovePlayerFromVehicle(playerid);
}
else if(GetVehicleModel(vehicleid) == 599)
{
RemovePlayerFromVehicle(playerid);
}
return 1;
}
Try this.
Re: RemovePlayerFromVehicle not working -
bartje01 - 23.07.2010
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z)l
SetPlayerPos(playerid,X,Y+0.5,Z);
try this if the others don't work
Re: RemovePlayerFromVehicle not working -
Emanuel_Rodriguez - 23.07.2010
nope, didnt work.
Re: RemovePlayerFromVehicle not working -
Emanuel_Rodriguez - 23.07.2010
Quote:
Originally Posted by bartje01
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z)l
SetPlayerPos(playerid,X,Y+0.5,Z);
try this if the others don't work
|
why would i try this?
Re: RemovePlayerFromVehicle not working -
Toni - 23.07.2010
@ MisterTickles code should work, you need to get the vehicleid before removing them from the actual vehicle.
Re: RemovePlayerFromVehicle not working -
Яσскѕтая - 23.07.2010
Quote:
Originally Posted by Emanuel_Rodriguez
why would i try this?
|
Because he's right...
pawn Код:
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
if(GetVehicleModel(vehicleid) == 596)
{
SetPlayerPos(playerid,x,y,z+2.0);
}
if(GetVehicleModel(vehicleid) == 599)
{
SetPlayerPos(playerid,x,y,z+2.0);
}
Tested it, it works.
It goes under OnPlayerEnterVehicle