SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 01/08/2010, 10:15 AM   #1
Ash.
High-roller
 
Ash.'s Avatar
 
Join Date: Jan 2010
Location: England
Posts: 2,137
Reputation: 160
Cool Simple Gates | 1 Line, 1 Gate

Hello all,
I woke up this morning, and thought about what i could do for you guys, well, seeing as this is my first release, and i know everyone for the first release has done an AFK system, well i like to be different, and i havent seen many of these gate scripts, so here it is:

http://pawn.pastebin.com/AEW4uZRK

Installation:
Copy the file into your PAWN Compiler, add any gates that are required, click compile! Copy it into your FilterScripts folder, and add {your file name} to the filterscripts line in server.cfg

Example gate?
I have included an example gate, near the crossover where the house is in SOUTH LV (You do a mission with a monster truck there) - I do however reccomened you comment this gate out, and only use it as an example to copy off, as people can just walk round this gate!

Add me a gate?
Send me your co-ordinates (open x, y, z, rotx, roty, rotz and closed x, y, z) and ill happily do it for you

Explain how to?
Ok. This script uses an array and loops to create and operate the gates, it loops for a defined amount of gates. The script then create a "command" loop, so it waits for a players command, and tries to find it in the array. You need to fill in all the details requested in the array. Like so:

pawn Code:
{gateid, closedx, closedy, closedz, rotationx, rotationy, rotationz, openx, openy, openz, command (with /), gatemodel}

Gate ID: Means the "number" of the gate
Gate Model: The actual ID of the object you wish to be the gate

To get these coordinates, use a map editor, or SAMP's /save function (although this may not be very accurate for what you want it for)

I need help?!
PM me

I hope you enjoy this script, it was quite irritating to make, but as usual, just a couple of numbers and letters fixed it

Edit: If anybody wants this converting to dcmd, let me know and ill do it for you

Thanks
Ash

Credits:
dice7 - Array/Enum fix
SAMP Team - Creating such a wonderful thing
SAMP Forum - for all the comments and posts that have helped me learn PAWN - im quite good now, according to some people

Enjoy

Last edited by Ash.; 06/08/2010 at 09:16 AM.
Ash. is offline   Reply With Quote
Old 01/08/2010, 10:22 AM   #2
Joe_
Gangsta
 
Join Date: Mar 2010
Location: UK, Essex
Posts: 573
Reputation: 1
Default Re: Simple Gates | 1 Line, 1 Gate

The code looks ok, but the array is really static, there's no need for the MAX_GATES constant, you can keep the 1st dimenon empty, aslong as you are filling the array from there, you cannot create a empty array and do something with it anywhere else in the script, otherwise the size will be 0.

And you should remove the timer when you use the command, quick look through 'callbacks' will give you a good idea

Anyway it's a nice job, I like your command operating idea.
__________________
I'm coding a from scratch roleplay server, it's called Stanoplo Gaming.
If you want to try out a new roleplay server, follow my development at:

http://www.stanopolo.com/forum/index.php

Last edited by Joe_; 02/08/2010 at 08:26 PM.
Joe_ is offline   Reply With Quote
Old 01/08/2010, 10:30 AM   #3
nuriel8833
High-roller
 
nuriel8833's Avatar
 
Join Date: Jun 2009
Location: Israel
Posts: 1,189
Reputation: 16
Default Re: Simple Gates | 1 Line, 1 Gate

Simple,but very cool and usefull
Ty!
__________________
Back to forums
Although I am not scripting much,only my gamemode on my free time

My works:
80.179.219.89:7778
[Tutorial] Kills Table BonusLast.fm
nuriel8833 is offline   Reply With Quote
Old 01/08/2010, 10:51 AM   #4
Ash.
High-roller
 
Ash.'s Avatar
 
Join Date: Jan 2010
Location: England
Posts: 2,137
Reputation: 160
Default Re: Simple Gates | 1 Line, 1 Gate

Quote:
Originally Posted by Joe_ View Post
The code looks ok, but the array is really static, there's no need for the MAX_GATES constant, you can keep the 1st dimenon empty, aslong as you are filling the array from there, you cannot create a empty array and do something with it anywhere else in the script, otherwise the size will be 0.

And you should remove the timer when you use the command, quick look through 'callbacks' will give you a good idea

And the gateid varible in your array is rather useless, you could just use the index of the array as the gateid, it's not as complex as it sounds.

Anyway it's a nice job, I like your command operating idea.
Cheers mate - i just took a look at your jGate system, and it look quite literally, awesome

About you're gateid comment, i use that as the name so i can trigger move object with that number, and then hopefully, noobish users get the drift a bit better

Thanks
Ash
Ash. is offline   Reply With Quote
Old 01/08/2010, 11:14 AM   #5
Joe_
Gangsta
 
Join Date: Mar 2010
Location: UK, Essex
Posts: 573
Reputation: 1
Default Re: Simple Gates | 1 Line, 1 Gate

Haha sorry, I forgot that you actually do need the gateid varible (I have it too), talked before I thought, forgive me lol.
__________________
I'm coding a from scratch roleplay server, it's called Stanoplo Gaming.
If you want to try out a new roleplay server, follow my development at:

http://www.stanopolo.com/forum/index.php
Joe_ is offline   Reply With Quote
Old 01/08/2010, 11:24 AM   #6
[MWR]Blood
High-roller
 
Join Date: Apr 2009
Posts: 2,404
Reputation: 105
Default Re: Simple Gates | 1 Line, 1 Gate

Really good, awesome work mate!
Keep it up
__________________
[MWR]Blood is offline   Reply With Quote
Old 01/08/2010, 01:29 PM   #7
Ash.
High-roller
 
Ash.'s Avatar
 
Join Date: Jan 2010
Location: England
Posts: 2,137
Reputation: 160
Default Re: Simple Gates | 1 Line, 1 Gate

Quote:
Originally Posted by Montserrat View Post
Simple,but very cool and usefull
Ty!
Thanks Anytime
Ash. is offline   Reply With Quote
Old 01/08/2010, 01:31 PM   #8
Ash.
High-roller
 
Ash.'s Avatar
 
Join Date: Jan 2010
Location: England
Posts: 2,137
Reputation: 160
Default Re: Simple Gates | 1 Line, 1 Gate

Quote:
Originally Posted by ikarus View Post
Really good, awesome work mate!
Keep it up
Cheers I will, hopefully

Quote:
Originally Posted by _Joe
Haha sorry, I forgot that you actually do need the gateid varible (I have it too), talked before I thought, forgive me lol.
Well done Ill let you off

*Double Post, sorry
Ash. is offline   Reply With Quote
Old 01/08/2010, 09:09 PM   #9
markokk888
Big Clucker
 
markokk888's Avatar
 
Join Date: Mar 2010
Posts: 72
Reputation: 0
Default Re: Simple Gates | 1 Line, 1 Gate

Simple and nice
__________________



http://www.puslapiai.lt/?mark
markokk888 is offline   Reply With Quote
Old 02/08/2010, 08:16 AM   #10
Ash.
High-roller
 
Ash.'s Avatar
 
Join Date: Jan 2010
Location: England
Posts: 2,137
Reputation: 160
Default Re: Simple Gates | 1 Line, 1 Gate

Quote:
Originally Posted by markokk888 View Post
Simple and nice
Thanks
Ash. is offline   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
[FilterScript] [FS] GateScript - One Line Gates jyrno42 Filterscripts 17 22/04/2011 02:52 PM
[Include] [INC] Awa-Gates - Simple Gate System pagie1111 Includes 7 15/04/2010 12:20 PM
[Include] [INC] 0.1 || Easy Gate Script || 1 Line per gate. [F.U.D.D.S] Includes 33 17/01/2010 04:06 PM
I NEED SOMEBODY TO DO 4 SIMPLE GATES SLaY3R Help Archive 0 15/03/2009 07:21 AM
Simple Gate Austin_Lynn Help Archive 1 06/03/2009 07:56 AM


All times are GMT. The time now is 10:31 AM.


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