[HELP] OnPlayerEnterVehicle - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] OnPlayerEnterVehicle (
/showthread.php?tid=173079)
[HELP] OnPlayerEnterVehicle -
MartinDee - 01.09.2010
Here's a script:
pawn Код:
public OnPlayerEnterVehicle( playerid, vehicleid, ispassenger )
{
new PlayerVehicle = GetVehicleFileID( GetPlayerVehicleID( playerid ) );
if (Vehicles[PlayerVehicle][CarTeam] != 0 && Vehicles[PlayerVehicle][CarTeam] != Player[playerid][Team] && !ispassenger)
{
//clear
}
else
{
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
SetPlayerPos(playerid, cx, cy, cz);
}
return 1;
}
And the problem is:
If I am setted in 1st Team, I can't enter car, if Im in other Teams I still can't enter those cars. And I'm sure I have setted those cars for Team 1. So what I have done wrong?
Re: [HELP] OnPlayerEnterVehicle -
LarzI - 01.09.2010
pawn Код:
public OnPlayerEnterVehicle( playerid, vehicleid, ispassenger )
{
new PlayerVehicle = GetVehicleFileID( GetPlayerVehicleID( playerid ) );
if ((Vehicles[PlayerVehicle][CarTeam] != 0) && (Vehicles[PlayerVehicle][CarTeam] != Player[playerid][Team]) && !ispassenger)
RemovePlayerFromVehicle( playerid );
return 1;
}
Just for fun, try that.
Re: [HELP] OnPlayerEnterVehicle -
MartinDee - 01.09.2010
pawn Код:
new PlayerVehicle = GetVehicleFileID( GetPlayerVehicleID( playerid ) );
if ((Vehicles[PlayerVehicle][CarTeam] != 0) && (Vehicles[PlayerVehicle][CarTeam] != Player[playerid][Team]) && !ispassenger)
RemovePlayerFromVehicle( playerid );
SendClientMessage( playerid, WHITE, "Test" );
Same...