SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 10/08/2012, 11:19 AM   #1
Riddick94
High-roller
 
Riddick94's Avatar
 
Join Date: Mar 2010
Posts: 1,706
Reputation: 132
Default Vehicle lock function

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 Code:
#define     OwnedVeh(%0)                    PlayerInfo[%0][pPlayerVehicle]

Variable: "pPlayerVeh" is just an enum of PlayerInfo.

pawn Code:
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..
__________________
Looking for mappers...
... to re-create The Last of Us world on San Andreas map. Interested people, please contact me through private message or Skype: "riddick9494".





Scripting help
I am willing to help people to fix/manage and/or write their filterscripts/gamemodes from scratch for money.
Contact me via e-mail or just send me a private message.

FIXING ONLY IF you have created a thread asking for help beforehand!
Riddick94 is online now   Reply With Quote
Old 10/08/2012, 02:14 PM   #2
Riddick94
High-roller
 
Riddick94's Avatar
 
Join Date: Mar 2010
Posts: 1,706
Reputation: 132
Default Re: Vehicle lock function

Anyone?
__________________
Looking for mappers...
... to re-create The Last of Us world on San Andreas map. Interested people, please contact me through private message or Skype: "riddick9494".





Scripting help
I am willing to help people to fix/manage and/or write their filterscripts/gamemodes from scratch for money.
Contact me via e-mail or just send me a private message.

FIXING ONLY IF you have created a thread asking for help beforehand!
Riddick94 is online now   Reply With Quote
Old 10/08/2012, 04:00 PM   #3
Riddick94
High-roller
 
Riddick94's Avatar
 
Join Date: Mar 2010
Posts: 1,706
Reputation: 132
Default Re: Vehicle lock function

Fixed by myself, -_-

"/lock thread".
__________________
Looking for mappers...
... to re-create The Last of Us world on San Andreas map. Interested people, please contact me through private message or Skype: "riddick9494".





Scripting help
I am willing to help people to fix/manage and/or write their filterscripts/gamemodes from scratch for money.
Contact me via e-mail or just send me a private message.

FIXING ONLY IF you have created a thread asking for help beforehand!
Riddick94 is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to lock this vehicle handerson Help Archive 2 01/07/2011 11:46 AM
How to lock car/vehicle in 0.3c ? Matej_ Help Archive 7 19/06/2011 06:09 PM
[help] lock vehicle igalsok Help Archive 3 17/05/2010 07:12 AM
[HELP] Vehicle lock Frankox Help Archive 2 05/04/2009 01:05 PM
vehicle lock & vehicle unlock SuperS0nic Help Archive 5 29/03/2009 06:33 AM


All times are GMT. The time now is 12:41 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.