SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 17/05/2011, 09:57 AM   #1
Squidle
Little Clucker
 
Join Date: May 2011
Posts: 3
Reputation: 0
Question Garage help

Greetings, everyone.

I am very new to scripting in SAMP. This is also my first thread. I have read some tutorials, I understand the basics (somewhat) and have scripted a few easy things.

But, now I want to create some Garage "system". I want two variations.

The first one
What I want: You drive in your car and pick up a pickup. Then you're able to do something like /enter. If you're not on the pick up, you're unable to enter it.
I know how to create a pickup and make it into a variable. I also got the coordinates. But, I don't know how I could script it so you have to write /enter once you picked it up.

The pickup up:
pawn Code:
new GaragePickup;
public OnGameModeInit()
{
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1877.9052734375,-1737.6791992188,13.355146,180, 0, 0, 0, 0, 0, 0);
    AddStaticVehicle(587, -1745.3572998047, 982.47320556641, 17.678091049194, 270, 38, 1);
    AddStaticVehicle(587, 1886.4532470703, -1746.6672363281, 13.356875419617, 90, 38, 1);
    GaragePickup = CreatePickup(3096,2,1866.1990966797,-1760.0908203125,13.546875,-1);
    return 1;
}

I have no clue what to do next, so a little help please?
Coordinates:
Code:
Playerspawn:	1877.9052734375,-1737.6791992188,13.355146,180
Where the player starts
Garage1: 	1884.8843994141,-1760.4916992188,13.546875
Where the pickup is and the entrace of the garage.
InGarage: 	-1747.0718994141,987.37799072266,18.087209701538
Where you should be teleported to when you enter it. (Also you should be able to do /exit here as well.
The second
What I want: You can drive to this point and use /storev(ehicle) so the car despawn and you can spawn it back later.
There should be a pickup here as well and I want these commands available:
/checkv - Shows which vehicles are in the garage.
/storev - Explained above, this should store your car in the garage (despawn).
/getv - Spawns the vehicle again

If it's possible, could there be a limit of 3 vehicles in the garage?
The coordinate of this garage is:
Code:
Garage2:	1866.1990966797,-1760.0908203125,13.546875
Thanks a lot!
Squidle is offline  
Old 18/05/2011, 10:47 AM   #2
Squidle
Little Clucker
 
Join Date: May 2011
Posts: 3
Reputation: 0
Default Re: Garage help

Ok, I found out that I should add if(IsPlayerInRangeOfPoint(playerid, range, x, y, z)).

But somewhat my commands do not work. Once I use /enter, I can't use /exit. Is the return the problem?
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/enter", cmdtext, true, 6) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 10, 1866.1990966797,-1760.0908203125,13.546875))
            {
                SetPlayerPos(playerid,-1747.0718994141,987.37799072266,18.087209701538);
                return 1;
            }
        return 1;
    }
    if (strcmp("/exit", cmdtext, true, 5) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 10, -1747.0718994141, 987.37799072266, 18.087209701538))
            {
                SetPlayerPos(playerid,1866.1990966797,-1760.0908203125,13.546875);
                return 1;
            }
        return 1;
    }
    return 1;
}
Squidle is offline  
 

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
Garage? pliptm Help Archive 0 31/03/2011 09:18 PM
[Map] Garage (Good for RP) Frederico Maps 14 07/03/2011 10:47 PM
about garage gupey1984 Help Archive 2 21/07/2010 07:27 PM
Garage? Edward94 Help Archive 2 24/07/2009 08:41 PM


All times are GMT. The time now is 07:53 PM.


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