Why is this not working - 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: Why is this not working (
/showthread.php?tid=357279)
Why is this not working -
Euan Hughes - 06.07.2012
Why does this still let me get into the passenger seat of this truck
pawn Код:
if(vehicleid == 403 || vehicleid == 591)
{
if(ispassenger == 1)
{
ClearAnimations(playerid);
}
}
If you need any more code just ask
Please help
Thanks
Re: Why is this not working -
Roko_foko - 06.07.2012
Because you say program if someone is attempting to enter the Vehicles with ids 403,591 as a passanger to stop dooing that. Clean that part of code if you want to allow othes to enter the car as passangers
Re: Why is this not working -
Euan Hughes - 06.07.2012
Quote:
Originally Posted by Roko_foko
Because you say program if someone is attempting to enter the Vehicles with ids 403,591 as a passanger to stop dooing that. Clean that part of code if you want to allow othes to enter the car as passangers
|
I dont understand
I dont want people to be able to enter the vehicle as a passenger
If you need any more code just ask
Please help
Thanks
Re: Why is this not working -
.FuneraL. - 06.07.2012
pawn Код:
if(vehicleid == 403 || vehicleid == 591)
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
ClearAnimations(playerid);
}
}
Try this.
Re: Why is this not working -
Roko_foko - 06.07.2012
Quote:
Originally Posted by Euan Hughes
I dont understand
I dont want people to be able to enter the vehicle as a passenger
If you need any more code just ask
Please help
Thanks
|
Oh I didn't read well.
Sorry.
I would change ClearAnimations(playerid); with
TogglePlayerControllable(playerid,0);
TogglePlayerControllable(playerid,1);
Re: Why is this not working -
Euan Hughes - 06.07.2012
Quote:
Originally Posted by .FuneraL.
pawn Код:
if(vehicleid == 403 || vehicleid == 591) { if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) { ClearAnimations(playerid); } }
Try this.
|
Did not work
If you need any more code just ask
Please help
Thanks
Re: Why is this not working -
Vince - 06.07.2012
vehicleid != modelid
https://sampwiki.blast.hk/wiki/GetVehicleModel
Re: Why is this not working -
Euan Hughes - 06.07.2012
Quote:
Originally Posted by Vince
|
Well the trucks are Static vehicles added on game mode in it and this part is stopping me from entering it as a driver now.. How can i fix this
pawn Код:
if(Vehicles[vehicleid][CarGroup] != 0 && Vehicles[vehicleid][CarGroup] != Player[playerid][Group])
{
if(ispassenger == 0)
{
ClearAnimations(playerid);
}
}
If you need any more code just ask
Please help
Thanks
Re: Why is this not working -
Jason` - 06.07.2012
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new model = GetVehicleModel(vehicleid);
if(model == 403 || model == 591)
{
if(ispassenger)
{
ClearAnimations(playerid);
}
}
return 1;
}