SA-MP Forums Archive
Vehicle lock function - 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: Vehicle lock function (/showthread.php?tid=367537)



Vehicle lock function - Riddick94 - 10.08.2012

Well.. it won't work, don't know why.. I need to check that near what vehicle player is.. because one player can own three vehicles..

Definition: "OwnedVeh"
pawn Код:
#define     OwnedVeh(%0)                    PlayerInfo[%0][pPlayerVehicle]
Variable: "pPlayerVeh" is just an enum of PlayerInfo.

pawn Код:
for(new i = 0; i < MAX_BUYABLE_VEH; i++)
        {
            if(strmatch(VehicleInfo[i][vVehOwner], PlayerName(playerid)))
            {
                new Float:X, Float:Y, Float:Z;
                GetVehiclePos(VehicleInfo[OwnedVeh(playerid)][vVehOwner], X, Y, Z);
                if(IsPlayerInRangeOfPoint(playerid, 5.0, X, Y, Z))
                {
                    ToggleVehicleStatus(VehicleInfo[i][vVehOwner], DOOR_STATUS);
                    ApplyAnimation(playerid, "BD_FIRE", "wash_up", 4.1, 0, 0, 0, 0, 0, 1);
                }
            }
        }
ToggleVehicleStatus works fine..


Re: Vehicle lock function - Riddick94 - 10.08.2012

Anyone?


Re: Vehicle lock function - Riddick94 - 10.08.2012

Fixed by myself, -_-

"/lock thread".