SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 22/06/2012, 11:30 AM   #1
Dare Devil.....
Huge Clucker
 
Dare Devil.....'s Avatar
 
Join Date: Jan 2012
Location: Pakistan
Posts: 253
Reputation: 10
Default Moveable Objects.

Hello,
Today I will tell you how can we make Moveable objects today in this case I will make Moveable Gates in this case

-Fisrt of all you need to have a map editor.((I will use MTA map editor))
If you use MTA map editor you need to convert for samp objects here ConvertFFS

-You need to make a Closed gate and save it to take the map it looks like this,





-Then you need to map a open gate like this





Once you have coordinates you will open your Pawno
Here are my coordinates
-CLOSED GATE CreateObject(969,2465.30004883,-1663.59997559,12.30000019,0.00000000,0.00000000,90 .00000000);
-OPEN GATE
CreateObject(969,2465.50000000,-1672.90002441,12.30000019,0.00000000,0.00000000,90 .00000000);

Now you need to open Pawno and select new,

First of all you need to define it like that,

pawn Code:
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

#endif
new gate;

after you are done with it you need to create object the closed gate,Take the coordinates for closed gate and do it like this, this should be done under Game Mode Init
pawn Code:
gate =   CreateObject(969,2465.30004883,-1663.59997559,12.30000019,0.00000000,0.00000000,90.00000000);
    return 1;
}

After you are done with this your gate is ready now you need to script the command to open and close it.
You can do that like this to Open your Gate

pawn Code:
if (strcmp("/open gate", cmdtext, true, 10) == 0)
    {
        MoveObject(gate,2465.50000000,-1672.90002441,12.30000019,1);//Open Gate
        return 1;
    }

After you are done with open gate command you need to script close gate command like this

pawn Code:
if (strcmp("/close gate", cmdtext, true, 10) == 0)
    {
        MoveObject(gate,2465.30004883,-1663.59997559,12.30000019,1);//Close Gate
        return 1;
    }

Do not for get to put return 0; at the end.

Once you are done with it your Gate is ready now, you can then test it.

Here is a link to my gate which I created if you need further help with it.

Paste Bin
Dare Devil..... is offline   Reply With Quote
Old 22/06/2012, 09:25 PM   #2
TaLhA XIV
Gangsta
 
TaLhA XIV's Avatar
 
Join Date: May 2012
Posts: 507
Reputation: 19
Default Re: Moveable Objects.

Nice Tutorial guy.
TaLhA XIV is offline   Reply With Quote
Old 22/06/2012, 11:40 PM   #3
Mimic
Huge Clucker
 
Mimic's Avatar
 
Join Date: Jul 2010
Posts: 203
Reputation: 6
Default Re: Moveable Objects.

Simple but helpful, good job.
__________________
Coming soon
Mimic is offline   Reply With Quote
Old 23/06/2012, 09:46 AM   #4
Dare Devil.....
Huge Clucker
 
Dare Devil.....'s Avatar
 
Join Date: Jan 2012
Location: Pakistan
Posts: 253
Reputation: 10
Default Re: Moveable Objects.

Well I created it simple my self so new people to scripting can eaisly understand it.
Dare Devil..... is offline   Reply With Quote
Old 23/06/2012, 12:38 PM   #5
newbienoob
High-roller
 
newbienoob's Avatar
 
Join Date: Jan 2012
Location: Follow the moaning coming from your parents' bedroom
Posts: 1,534
Reputation: 265
Default Re: Moveable Objects.

Looks same to [ame="http://www.youtube.com/watch?v=E_aO0Bp64I4"]this[/ame]
__________________
Help me, please /a chat
newbienoob is offline   Reply With Quote
Old 23/06/2012, 12:45 PM   #6
Lordzy
High-roller
 
Lordzy's Avatar
 
Join Date: Mar 2012
Location: NetherRealm
Posts: 2,702
Reputation: 1176
Default Re: Moveable Objects.

Thanks for the tutorial.
__________________
Currently inactive - I don't play at any SA-MP servers nor work on anything in PAWN for now. The projects that I've done so far in PAWN, which requires updates will be taking some time.
Lordzy is offline   Reply With Quote
Old 23/06/2012, 12:46 PM   #7
Djole1337
Gangsta
 
Join Date: Apr 2012
Posts: 874
Reputation: 303
Default Re: Moveable Objects.

Quote:
Originally Posted by newbienoob View Post
Looks same to this
Obv c/p...
__________________
YouKnowWho
Djole1337 is offline   Reply With Quote
Old 23/06/2012, 12:55 PM   #8
abubaker98
Big Clucker
 
abubaker98's Avatar
 
Join Date: Apr 2010
Location: My room.
Posts: 88
Reputation: 3
Default Re: Moveable Objects.

Nice work
abubaker98 is offline   Reply With Quote
Old 24/06/2012, 07:02 AM   #9
Dare Devil.....
Huge Clucker
 
Dare Devil.....'s Avatar
 
Join Date: Jan 2012
Location: Pakistan
Posts: 253
Reputation: 10
Default Re: Moveable Objects.

Quote:
Originally Posted by Mr_DjolE View Post
Obv c/p...
Its not a Copy at all I made this one My self.
Dare Devil..... is offline   Reply With Quote
Old 24/06/2012, 07:12 AM   #10
CaptainMactavish
Huge Clucker
 
CaptainMactavish's Avatar
 
Join Date: Jun 2012
Location: Argentina
Posts: 339
Reputation: 18
Default Respuesta: Re: Moveable Objects.

Quote:
Originally Posted by Dare Devil..... View Post
Its not a Copy at all I made this one My self.
He didn't tell you that you copied, he said that there's many tutorials like this.
Back to the topic, I see you're new then I should say that you did a good job.
__________________


Quote:
Originally Posted by dugi in Slice's Visitor Messages LOL
Donde, está, la biblioteca. Me llamo T-Bone La araña discoteca. Discoteca, muñeca, La biblioteca Está en bigotes grandes, el perro, manteca. Manteca, bigotes, gigante, pequeño, la cabeza es nieve, cerveza es bueno. Buenos dias, me gusta papas frías, los bigotes de la cabra Es Cameron Diaz.
CaptainMactavish 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
[Help] Moveable Textdraw Mrki_Drakula Help Archive 2 11/08/2011 04:43 PM
How to moveable barrier? Aizen Help Archive 13 23/04/2011 07:40 AM
Moveable Objects for 0.3c version Amel_PAtomAXx Help Archive 10 05/03/2011 12:36 PM
Moveable gate. Kyle. Help Archive 15 06/02/2011 01:37 PM


All times are GMT. The time now is 05:50 PM.


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