PDA

View Full Version : [Tutorial] Moving Gates, Elevators Etc.


Snyper18
09/01/2009, 01:13 AM
Hello, Many people have asked me " Can you help me make a moving gate" So now i am showing a tutorial of how to make one.

Alright first, We need cords.
Step 1. Go to the place you want your gate to be, /save Gate
Step 2. Now go to the place where you want your gate to move to ( I usually make it move up. )
Step 3. Then get the Cords for when it moves back down.
Step 4. Go to your GTA SA File ( Located In ProgramFiles/Rockstargames/Grand Theft Auto GTA SA/ And search for Saved Positions.


Example code :


First, add
( new elevator; ) Near the top of your script, I will be using the Object named "elevator" You can edit this.
Example : new elevator;


Second,Get the cords of where your gate,elevator etc is. Make sure it's the cord of where it's closed.
Then add something like this, Put it under your Vehicle spawns/skins/objects- you pick.

Now it should look like this :
elevator = CreateObject( 2669 , -1489.413085 , 2624.577148 , 61.223720 , 0.000000 , 0.000000 , 358.000000 );
^ ^
| |
Is the object name Object id ( Now the wrest is the cords. Put yours in )

And now the final step!

Put your command in under "OnPlayerCommandText" - Edit this command to your wishes.

if(strcmp(cmd, "/eup", true) == 0) { // Edit the /eup to your elevator command.
MoveObject(elevator,-1489.413085,2624.461914,84.440391,2.00); // Put your cords in here
SendClientMessage(playerid, COLOR_RED, "You are now going up, Please Wait."); // You dont alwas have to put this in, delete if wanted.
return 1;
}
if(strcmp(cmd, "/edown", true) == 0) { // Same deal as before
MoveObject(elevator,-1489.413085,2624.461914,60.960697,-2.00); // Same deal as before
SendClientMessage(playerid, COLOR_RED, "The Elevator is now comming, Please Wait."); // Same deal as before
return 1;
}
And Tada ! Your done. Enjoy your moving gates.
Please tell me if this helped you at all, If not i can explain better in a Pm etc.
- Hugs from Bruzer :p

g@k
09/01/2009, 01:28 AM
Not bad ^^ , next time with OnPlayerToPoint :D

Snyper18
09/01/2009, 01:30 AM
Oh shoot! Forgot about that :p

But i find this way more simple for newbies .
Even for me!

flames
09/01/2009, 01:35 AM
Its great to find tutorials rather then questions in this section.

Snyper18
09/01/2009, 01:35 AM
So true, Saves time, Makes people happy.

g@k
09/01/2009, 01:35 AM
Yes .. but with OnPlayerToPoint , Not need to do some commands and lost time :D and it's the must for me , i think

Snyper18
09/01/2009, 01:40 AM
Like i said, Not all like it like that. :p

Nimphious
09/01/2009, 01:40 AM
Yes .. but with OnPlayerToPoint , Not need to do some commands and lost time :D and it's the must for me , i think


Nope soz, the onplayertopoint is if you want everyone to be able to goto that object and it moves, what if you have a gate and you only want to be the person to get in :roll:

Snyper18
09/01/2009, 01:51 AM
Then set the team.
Of who can call the gate etc.

Jari
14/01/2009, 11:02 PM
can you post for others object names, example for gates, if i dont want elevater

Snyper18
14/01/2009, 11:04 PM
http://wiki.sa-mp.com/wiki/Object_Structure_Fences%2C_Walls%2C_Gates%2C_and_B arriers

EDIT : Gate ids , 969,971,974,975,976,980,985,986,987

Joe Staff
15/01/2009, 02:03 AM
CreateGate(model, xPos, yPos, zPos, xTarget, yTarget, zTarget);

Creating a gate (or elevator if you set the target up) using YSI.


burn

Snyper18
15/01/2009, 11:03 AM
CreateGate(model, xPos, yPos, zPos, xTarget, yTarget, zTarget);

Creating a gate (or elevator if you set the target up) using YSI.


burn


Whats so burn about that, He's just explaining How his Program works..

Donny_k
15/01/2009, 02:25 PM
CreateGate(model, xPos, yPos, zPos, xTarget, yTarget, zTarget);

Creating a gate (or elevator if you set the target up) using YSI.


Is there something wrong with you today ? That's mighty short for one of your tutorials ;)

Joe Staff
15/01/2009, 03:40 PM
CreateGate(model, xPos, yPos, zPos, xTarget, yTarget, zTarget);

Creating a gate (or elevator if you set the target up) using YSI.


Is there something wrong with you today ? That's mighty short for one of your tutorials ;)


All my YSI tutorials are short because it's designed to be quick and easy to use :D.

Anyway, it wasn't a burn, he wrote a tutorial, I gave additional information for the tutorial, as I hope people do on mine.


That's not additional information, that's re-writing his tutorial

Snyper18
15/01/2009, 03:56 PM
No it's not, Stop post huntin buddy, it's pointless

Jari
15/01/2009, 06:08 PM
Is there any need for define object, and can you paste tutorial for walls, and barries

Snyper18
15/01/2009, 07:06 PM
You mean how to make a Wall..? Just get the object ID and Put the cords of where you want it.

Jari
15/01/2009, 07:25 PM
You mean how to make a Wall..? Just get the object ID and Put the cords of where you want it.


ok,tnx, but is there any web site where is IDs and pictures of objects

Snyper18
15/01/2009, 09:18 PM
****** SAMP WIKI.

Guziiinho
06/02/2009, 03:21 PM
Bruzer look , i put ,

new gates; (in the variebles part)

CreateObject(980, 1316.275757, -2725.842773, 15.349422, 0.0000, 0.0000, 326.2500); ( in the objects par )

and put

if(strcmp(cmdtext, "/opengate", true) == 0) {
MoveObject(980, 1316.275757, -275.842773, 15.324396, 2.00);
return 1;
}
if(strcmp(cmdtext, "/closegate", true) == 0) {
MoveObject(1316.275757, -2725.842773, 15.349422, 2.00);
return 1;
}

in OnPlayerCommandText , THE /opengate DON'T SAY UNKNOWN COMMAND , JUST THE GATE DON'T OPEN, AND THE /closegate SAY UNKNOWN COMMAND , WHAT'S WRONG WITH THE SCRIPT ?

Snyper18
06/02/2009, 03:59 PM
gates = CreateObject(980, 1316.275757, -2725.842773, 15.349422, 0.0000, 0.0000, 326.2500);


if(strcmp(cmdtext, "/opengate", true) == 0) {
MoveObject(gates,1316.275757, -2725.842773, 15.349422);
return 1;
}
if(strcmp(cmdtext, "/closegate", true) == 0) {
MoveObject(gates,1316.275757, -2725.842773, 15.349422, 2.00);
return 1;
}

Put the gates = CreateObject(980, 1316.275757, -2725.842773, 15.349422, 0.0000, 0.0000, 326.2500); in the object Spot.

Guziiinho
06/02/2009, 04:05 PM
It is in the Object Spot.

Snyper18
06/02/2009, 04:06 PM
Is gates = CreateObject(980, 1316.275757, -2725.842773, 15.349422, 0.0000, 0.0000, 326.2500); In the object part?

Use this also


if(strcmp(cmdtext, "/opengate", true) == 0) {
MoveObject(gates,1316.275757, -2725.842773, 15.349422);
return 1;
}
if(strcmp(cmdtext, "/closegate", true) == 0) {
MoveObject(gates,1316.275757, -2725.842773, 15.349422, 2.00);
return 1;
}

Guziiinho
06/02/2009, 04:19 PM
I copy your command that you said now, and it still the same , the /closegate Still Unkown command and /opengate don't do nothing .

One little question , in your command that you post now , the /opengate MoveObject is (objectid, Float:X, Float:Y, Float:Z) But where's the speed ? must be (objectid, Float:X, Float:Y, Float:Z, Float:Speed) is i correct ? you put the speed in /closegate MoveObject , why not put in the /opengate MoveObject speed ?

Snyper18
06/02/2009, 04:24 PM
2.00 Is the speed, At the end.

EDIT : And the /opengate (objectid) Is wrong, It has to be what the gate is called

Yours is called gates So put the /opengate

With MoveObject,gates,(etc etc etc etc)

Guziiinho
06/02/2009, 04:35 PM
I'm so confused :-[ sorry for getting your time,

can you show me how it would be ?

write commands, and i test okay ? :/

SORRY , SORRY , SORRY :(

Prieto_Galletini
13/02/2009, 02:34 PM
ok you seem to know about gates i have a question i already have them gates in Ladminv4.2 and i was just wondering how to make it that only admins can use the gates and by the way they're automatic gates so i have no commands.

im new to scripting and don't know just short terms f you can explain it to me the easy way,other thing i used the so called friendly button(search) and i couldn't find anything in the search and it took me 2 and i half hour looking and didn't even find the sticky bout gates that ppl talk about

Omega90210
15/02/2009, 01:43 AM
Heres my problem:

I want to make a gate in front of a house for increased security, the thing is i can get the coordinates ok, but when i put the create object in the pawno, it spawns the gate over the correct coords, but like 5 feet in the air, and pointing the wrong way. How do i fix those, how do i find the percise rotation coordinates? Do you see what i mean?

Joe Staff
15/02/2009, 04:48 AM
Most objects are offset, so you'll either have to use an editor of some type or adjust them manually

[H]InVion_
16/02/2009, 09:46 PM
Question.

Here:
if(strcmp(cmd, "/eup", true) == 0) { // Edit the /eup to your elevator command.
MoveObject(elevator,-1489.413085,2624.461914,84.440391,2.00); // Put your cords in here
SendClientMessage(playerid, COLOR_RED, "You are now going up, Please Wait."); // You dont alwas have to put this in, delete if wanted.
return 1;
}
if(strcmp(cmd, "/edown", true) == 0) { // Same deal as before
MoveObject(elevator,-1489.413085,2624.461914,60.960697,2.00); // Same deal as before
SendClientMessage(playerid, COLOR_RED, "The Elevator is now comming, Please Wait."); // Same deal as before
return 1;
}

At the
MoveObject(elevator,-1489.413085,2624.461914,60.960697,2.00); // Same deal as before
Do I have to change the coords so that it goes down,
say my coords were
-1489.413085,2624.461914,60.960697,2.00
Do I have to change it to
-1450.413085,2624.461914,60.960697,2.00
on the /edown command or something, so that it makes a difference?

Edit:
I followed this and I get about 50 errors..

Joe Staff
16/02/2009, 09:49 PM
if it starts there, /edown should make it go there, so you're right in that bit of script

typedef
16/02/2009, 11:25 PM
For the coordinates you want it to move up how would you do that, just add numbers to the y value, or can you float up

Snyper18
17/02/2009, 12:07 AM
Add the cords on the Y cord to make it go up.

Joe Staff
17/02/2009, 12:25 AM
You guys mean the Z value right? Y would be north and south...

Snyper18
17/02/2009, 12:30 AM
Blah!, Im tired,im sick, And yeah.. wat eva u say xD

[H]InVion_
17/02/2009, 08:10 AM
OK.. which one is the Z value in this code?:
(980, 528.965149, 2975.480713, 5.272058, 0.0000, 0.0000, 0.0000, 500);

[H]InVion_
17/02/2009, 09:25 AM
Sorry for double post, but I followed this properly and I got these errors:

C:\DOCUME~1\Francis\Desktop\server\GAMEMO~1\lva.pw n(89) : error 029: invalid expression, assumed zero
C:\DOCUME~1\Francis\Desktop\server\GAMEMO~1\lva.pw n(89) : warning 215: expression has no effect
C:\DOCUME~1\Danny\Desktop\server\GAMEMO~1\lva.pwn( 89) : error 029: invalid expression, assumed zero
C:\DOCUME~1\Danny\Desktop\server\GAMEMO~1\lva.pwn( 89 -- 91) : warning 215: expression has no effect
C:\DOCUME~1\Danny\Desktop\server\GAMEMO~1\lva.pwn( 91) : error 001: expected token: ";", but found "-identifier-"
C:\DOCUME~1\Danny\Desktop\server\GAMEMO~1\lva.pwn( 91) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.


I'm running the Las Venturas Arena GM.
Here is the first bit of code:
(the beggining bit about the skins are just random, I didn't mean to copy them)

if ( IsValidSkin( i ) && i != 217 && i != 211 ) AddPlayerClass( i,1958.3783, 1343.1572, 15.3746, 270.1425, 0, 0, 0, 0, 0, 0 );
}

(This is line 89) (new gate;)

AddStaticVehicle(538,1466.7051,2634.2603,10.5424,2 69.5424,1,1); // Brown Streak!

gate = CreateObject(980, 528.965149, 2975.480713, 5.272058, 0.0001, 0.0000, 0.0000, 500);

loadV_Admin ( );

new
vSet = random( 2 );



Lines 89 to 93 (I know errors are to 91 but oh well)

(new gate;)

AddStaticVehicle(538,1466.7051,2634.2603,10.5424,2 69.5424,1,1); // Brown Streak!

gate = CreateObject(980, 528.965149, 2975.480713, 5.272058, 0.0001, 0.0000, 0.0000, 500);

How can I fix this?
Thanks.

MenaceX^
17/02/2009, 09:46 AM
OK.. which one is the Z value in this code?:
(980, 528.965149, 2975.480713, 5.272058, 0.0000, 0.0000, 0.0000, 500);

5.272058, 0.0000

[H]InVion_
17/02/2009, 09:48 AM
OK.. which one is the Z value in this code?:
(980, 528.965149, 2975.480713, 5.272058, 0.0000, 0.0000, 0.0000, 500);

5.272058, 0.0000


Thanks, :) but I worked that out yesterday.

[H]InVion_
17/02/2009, 04:56 PM
I still really need help... please :x


Sorry for double post, but I followed this properly and I got these errors:

C:\DOCUME~1\Francis\Desktop\server\GAMEMO~1\lva.pw n(89) : error 029: invalid expression, assumed zero
C:\DOCUME~1\Francis\Desktop\server\GAMEMO~1\lva.pw n(89) : warning 215: expression has no effect
C:\DOCUME~1\Danny\Desktop\server\GAMEMO~1\lva.pwn( 89) : error 029: invalid expression, assumed zero
C:\DOCUME~1\Danny\Desktop\server\GAMEMO~1\lva.pwn( 89 -- 91) : warning 215: expression has no effect
C:\DOCUME~1\Danny\Desktop\server\GAMEMO~1\lva.pwn( 91) : error 001: expected token: ";", but found "-identifier-"
C:\DOCUME~1\Danny\Desktop\server\GAMEMO~1\lva.pwn( 91) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.


I'm running the Las Venturas Arena GM.
Here is the first bit of code:
(the beggining bit about the skins are just random, I didn't mean to copy them)

if ( IsValidSkin( i ) && i != 217 && i != 211 ) AddPlayerClass( i,1958.3783, 1343.1572, 15.3746, 270.1425, 0, 0, 0, 0, 0, 0 );
}

(This is line 89) (new gate;)

AddStaticVehicle(538,1466.7051,2634.2603,10.5424,2 69.5424,1,1); // Brown Streak!

gate = CreateObject(980, 528.965149, 2975.480713, 5.272058, 0.0001, 0.0000, 0.0000, 500);

loadV_Admin ( );

new
vSet = random( 2 );



Lines 89 to 93 (I know errors are to 91 but oh well)

(new gate;)

AddStaticVehicle(538,1466.7051,2634.2603,10.5424,2 69.5424,1,1); // Brown Streak!

gate = CreateObject(980, 528.965149, 2975.480713, 5.272058, 0.0001, 0.0000, 0.0000, 500);

How can I fix this?
Thanks.

Snyper18
17/02/2009, 09:42 PM
Do you have " new gate " at the top of the script?

[H]InVion_
17/02/2009, 10:14 PM
Yes. At first I put them in brackets, but my brother (who is more advanced in scripting than myself) said to remove them. So I did and now I get lots of different errors. I'll post them once I've re-installed windows tomorrow.

Snyper18
17/02/2009, 11:07 PM
k

Guns_N_Roses
25/02/2009, 09:27 AM
new gate1; //216
gate1 = CreateObject(971, 1045.156616, -2337.926025, 15.914526, 0.0000, 0.0000, 348.7500);
new gate2;
gate2 = CreateObject(971, 1036.256104, -2336.166260, 15.936899, 0.0000, 0.0000, 168.7500);
new gate3;
gate3 = CreateObject(971, 641.526001, -4367.697754, 16.722958, 0.0000, 0.0000, 348.7500);
new gate4;
gate4 = CreateObject(971, 632.659607, -4365.994141, 16.760206, 0.0000, 0.0000, 168.7500); //223
if(strcmp(cmdtext, "/opennorthgate") == 0) //494
{
MoveObject(gate1, 1029.157715, -2334.756348, 15.916544 ,2.00);
MoveObject(gate2, 1052.657837, -2339.409424, 15.905632 ,2.00);
SendClientMessage(playerid,0x000000FF,"opening north gates...");
}

if(strcmp(cmdtext, "/closenorthgate") == 0)
{
MoveObject(gate1, 1045.156616, -2337.926025, 15.914526 ,2.00);
MoveObject(gate2, 1036.256104, -2336.166260, 15.936899 ,2.00);
SendClientMessage(playerid,0x000000FF,"closing north gates...");
}

if(strcmp(cmdtext, "/opensouthgate") == 0)
{
MoveObject(gate3, 646.726685, -4368.603516, 16.643801 ,2.00);
MoveObject(gate4, 627.415222, -4364.933594, 16.743708 ,2.00);
SendClientMessage(playerid,0x000000FF,"opening south gates...");
}

if(strcmp(cmdtext, "/closesouthgate") == 0)
{
MoveObject(gate3, 641.526001, -4367.697754, 16.722958 ,2.00);
MoveObject(gate4, 632.659607, -4365.994141, 16.760206 ,2.00);
SendClientMessage(playerid,0x000000FF,"closing south gates...");
} //520


C:\DOCUME~1\********\Desktop\myserver\GAMEMO~1\Bor n2Fly.pwn(223) : warning 204: symbol is assigned a value that is never used: "gate4"
C:\DOCUME~1\********\Desktop\myserver\GAMEMO~1\Bor n2Fly.pwn(221) : warning 204: symbol is assigned a value that is never used: "gate3"
C:\DOCUME~1\********\Desktop\myserver\GAMEMO~1\Bor n2Fly.pwn(219) : warning 204: symbol is assigned a value that is never used: "gate2"
C:\DOCUME~1\********\Desktop\myserver\GAMEMO~1\Bor n2Fly.pwn(217) : warning 204: symbol is assigned a value that is never used: "gate1"
C:\DOCUME~1\********\Desktop\myserver\GAMEMO~1\Bor n2Fly.pwn(496) : error 017: undefined symbol "gate1"
C:\DOCUME~1\********\Desktop\myserver\GAMEMO~1\Bor n2Fly.pwn(497) : error 017: undefined symbol "gate2"
C:\DOCUME~1\********\Desktop\myserver\GAMEMO~1\Bor n2Fly.pwn(503) : error 017: undefined symbol "gate1"
C:\DOCUME~1\********\Desktop\myserver\GAMEMO~1\Bor n2Fly.pwn(504) : error 017: undefined symbol "gate2"
C:\DOCUME~1\********\Desktop\myserver\GAMEMO~1\Bor n2Fly.pwn(510) : error 017: undefined symbol "gate3"
C:\DOCUME~1\********\Desktop\myserver\GAMEMO~1\Bor n2Fly.pwn(511) : error 017: undefined symbol "gate4"
C:\DOCUME~1\********\Desktop\myserver\GAMEMO~1\Bor n2Fly.pwn(517) : error 017: undefined symbol "gate3"
C:\DOCUME~1\********\Desktop\myserver\GAMEMO~1\Bor n2Fly.pwn(518) : error 017: undefined symbol "gate4"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


8 Errors.


can somebody please send me a fix for this? I'm completely lost =\

Donny_k
25/02/2009, 10:32 AM
Long answer:

You create the variables and the objects in the same scope so the rest of the script doesn't know what the variables are hence the errors. The warnings are basically for the same reason, you assign them a value with CreateObject but as they are local to that scope and you don't use them again then they have been "assigned a value which is never used".

Short answer:

Make the variables global (gate1, gate2 etc).

Guns_N_Roses
25/02/2009, 11:04 AM
wow... i cant believe it but.. i actually understood that O.O

i had the same errors for makin pickups that i eventually gave up on, but now that i know a fix im gonna go back and see if i can make em work

thanks alot!

i put the "new"s under #include <a_samp> and now both commands work great, cept they still say "unknown command" even when they work and im not sure how to make them for admins only.

FrazZ
04/03/2009, 01:32 AM
On noes, it says

C:\Users\Pivot\Desktop\Server\gamemodes\penls.pwn( 9219) : error 017: undefined symbol "cmd"
C:\Users\Pivot\Desktop\Server\gamemodes\penls.pwn( 9220) : warning 202: number of arguments does not match definition
C:\Users\Pivot\Desktop\Server\gamemodes\penls.pwn( 9225) : warning 217: loose indentation
C:\Users\Pivot\Desktop\Server\gamemodes\penls.pwn( 9225) : error 017: undefined symbol "cmd"
C:\Users\Pivot\Desktop\Server\gamemodes\penls.pwn( 9226) : warning 202: number of arguments does not match definition
C:\Users\Pivot\Desktop\Server\gamemodes\penls.pwn( 9231) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.

Snyper18
07/03/2009, 11:24 AM
On noes, it says

C:\Users\Pivot\Desktop\Server\gamemodes\penls.pwn( 9219) : error 017: undefined symbol "cmd"
C:\Users\Pivot\Desktop\Server\gamemodes\penls.pwn( 9220) : warning 202: number of arguments does not match definition
C:\Users\Pivot\Desktop\Server\gamemodes\penls.pwn( 9225) : warning 217: loose indentation
C:\Users\Pivot\Desktop\Server\gamemodes\penls.pwn( 9225) : error 017: undefined symbol "cmd"
C:\Users\Pivot\Desktop\Server\gamemodes\penls.pwn( 9226) : warning 202: number of arguments does not match definition
C:\Users\Pivot\Desktop\Server\gamemodes\penls.pwn( 9231) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.

Do you have the new pawno...?

FrazZ
07/03/2009, 02:55 PM
NVM, it works now. And yes I do :)

Jason_Larson
24/03/2009, 04:02 AM
I know this is a old topic.. but when I try to limit the gate command to IsACop or to a faction I get errors and bugs out the ass, anyhelp?


if(strcmp(cmd, "/jaileop", true) == 0) {
MoveObject(Jaile,1634.95,-1722.05,13.34,1.00);
SendClientMessage(playerid, COLOR_RED, "Calling Control to open gate.... Please Wait.");
return 1;
}
if(strcmp(cmd, "/jailecl", true) == 0) {
MoveObject(Jaile,1628.95,-1722.05,13.34,1.00);
SendClientMessage(playerid, COLOR_RED, "Calling Control to close gate, Please Wait.");
return 1;
}

Shellegg
24/03/2009, 10:47 AM
If we have a door inside an interior and we want to put it inside the wall, how we do it?

to get the "moveto" coords?

Shellegg
25/03/2009, 12:39 PM
I made my gate, for PD only and that correct :p

thanks for the tuturial, but i've a question..

How can we fix that problem using /save then putting an object ID and it apears flying on the air?
Ok, i can use MTA:SA to map editor, but that outside, i've this problem inside an interior..

Can anyone give me a tip about the rotation?

0.0000 is down ->up?

Martinike
30/03/2009, 09:53 PM
Thanks guy! I can now add gates :)

So much thanks guy!

I have one answer, how i add with
Typing /olspd and will
Jack_Kodama is using remote control to open gate. (/me)

Snyper18
01/04/2009, 05:55 PM
Thanks guy! I can now add gates :)

So much thanks guy!

I have one answer, how i add with
Typing /olspd and will
Jack_Kodama is using remote control to open gate. (/me)

Alright heres the code,

Add this to your forwards : forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
Then add, this

GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s takes his/her remote and opens a garage.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
Into your command when it moves, And if you get a error saying unknown collor Purple
add this to the define variables

#define COLOR_PURPLE 0xC2A2DAAA
Edit sorry for the very long time to reply..

ANd Shellegg.

I made my gate, for PD only and that correct :p

thanks for the tuturial, but i've a question..

How can we fix that problem using /save then putting an object ID and it apears flying on the air?
Ok, i can use MTA:SA to map editor, but that outside, i've this problem inside an interior..

Can anyone give me a tip about the rotation?

0.0000 is down ->up?

Use the In game map editor made by Kapil to get the cords.. xD kinda hard with MAp editor mate.

Shellegg
01/04/2009, 06:08 PM
I made it manually, i use my head to see +/- the size of how much the object is flying from the ground, and then i reduce the Z coord :P

Snyper18
01/04/2009, 06:20 PM
I made it manually, i use my head to see +/- the size of how much the object is flying from the ground, and then i reduce the Z coord :P


Oh.. k then

FrazZ
07/04/2009, 05:24 AM
SORRY FOR BUMP

-How can I make it timed?
Like:

/entercage
-500$
Wait 5 seconds
closes the gate.

MrPanz
10/06/2009, 10:37 PM
Uh... Not sure If you found this answer for yo question but yeh.

Heres how u would do it


forward GateClose(playerid);

( put this anywhere)
public GateClose(playerid)
{
MoveObject(etc etc )
return 1;
}


And then under onplayercommand u add this to ur command
: MoveObject(etc etc etc)
SetTimerEx("GateClose",2000,0,"i",playerid); Remember to edit the timer setting.

hipy
24/06/2009, 05:38 AM
Not bad ^^ , next time with OnPlayerToPoint :D


dude realy please remove the adds out of your sig............................................... .............................. :|

RayPoda
24/06/2009, 06:21 AM
Nice tutorial, I'll be giving it a shot here in a few. Mad props.

Jafri
25/06/2009, 02:49 PM
Hey what cords :S x,y,z then :S and how i get the cords????

KaneCW
05/07/2009, 05:16 PM
how can i do so that the command to open the gate only work with my name?

Niixie
11/08/2009, 12:46 PM
Great tut, it helped me alot.

I could use your help to learn me how to do so the command for the gate only is allowed to be used if the player is in the area

MrPanz
11/08/2009, 04:04 PM
Uhm.. Bruzer18 was banned on the forums.. So I dont think he can answer you're questions.

Machinehank34
11/08/2009, 04:10 PM
Very nice,
When i understand scripting,
i will try it :D
Greetz,
Machine.

TheNotorius
06/10/2009, 02:02 AM
Some help? i always get "undefined symbol, cmd"
and "undefined symbol, elevator"

and i did everything you said :(

Ehab1911
02/01/2010, 03:50 PM
Awesome!! thankss u just helped me.

braduz
09/01/2010, 04:47 PM
Hard to follow 1 error how the fuck is the lift supposed to move if there fucking the same commands
thanks for wasting my time :s

CAD3TZ
09/01/2010, 05:24 PM
???

braduz
13/01/2010, 06:39 PM
LOL!!
DONT U HAVE TO DEFINE CMD???????????
:lol:
anyway whats the code for that

christian_B
31/03/2010, 10:35 AM
I have 4 Errors:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext[/eup], true) == 0){ // Edit the /eup to your elevator command.
MoveObject(elevator,2861.450000,471.900000,-0.300000,0,0,0); // Put your cords in here
SendClientMessage(playerid, COLOR_RED, "You are now going up, Please Wait."); // You dont alwas have to put this in, delete if wanted.
return 1;
}(3113, 2859.05, 471.91, 8.61, 0.00, 0.00, 0.00)
if(strcmp(cmdtext, "/edown", true)==0) { // Same deal as before
MoveObject(elevator,2859.050000,471.910000,8.61000 000,0,0,0); // Same deal as before
SendClientMessage(playerid, COLOR_RED, "The Elevator is now comming, Please Wait."); // Same deal as before
return 1;
}

C:\...\lvrcr sicherung.pwn(36) : warning 201: redefinition of constant/macro (symbol "MAX_PICKUPS")
C:\...\lvrcr sicherung.pwn(2175) : warning 202: number of arguments does not match definition
C:\...\lvrcr sicherung.pwn(5314) : warning 235: public function lacks forward declaration (symbol "OnPlayerPrivmsg")
C:\...\lvrcr sicherung.pwn(5338) : error 029: invalid expression, assumed zero
C:\...\lvrcr sicherung.pwn(5338) : error 017: undefined symbol "eup"
C:\...\lvrcr sicherung.pwn(5338) : error 029: invalid expression, assumed zero
C:\...\lvrcr sicherung.pwn(5338) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

mamorunl
31/03/2010, 12:03 PM
if(strcmp(cmdtext,"/eup", true) == 0)
{ // Edit the /eup to your elevator command.
MoveObject(elevator,2861.450000,471.900000,-0.300000,0,0,0); // Put your cords in here
SendClientMessage(playerid, COLOR_RED, "You are now going up, Please Wait."); // You dont alwas have to put this in, delete if wanted.
return 1;
} // (3113, 2859.05, 471.91, 8.61, 0.00, 0.00, 0.00)
// I dont know what you want with those coords, but if you put them here like this, it aint gonna work
if(strcmp(cmdtext, "/edown", true)==0) { // Same deal as before
MoveObject(elevator,2859.050000,471.910000,8.61000 000,0,0,0); // Same deal as before
SendClientMessage(playerid, COLOR_RED, "The Elevator is now comming, Please Wait."); // Same deal as before
return 1;
}

I also thought that the syntax for moveobject() was:
MoveObject(OBJECT_ID,X,Y,Z,MOVE_SPEED); // where Object_id is 'elevator'

Also, I would recommend watching the other commands since you cannot put cmdtext[/cmd] you have to put: cmdtext,"/cmd"
I hope I made myself clear :D I am not the best in explaining

christian_B
31/03/2010, 12:58 PM
} // (3113, 2859.05, 471.91, 8.61, 0.00, 0.00, 0.00)
// I dont know what you want with those coords, but if you put them here like this, it aint gonna work

I use ingame object editor for the coordinats

MoveObject(OBJECT_ID,X,Y,Z,MOVE_SPEED); // where Object_id is 'elevator'


elevator=The carrier elevator =
3113 = carrier door
3114 = carrier lift 2
3115 = carrier lift 1

Thx for help.

gtachile
01/04/2010, 03:24 AM
I Have a problem:

C:\Documents and Settings\Administrador\Mis documentos\Descargas\gta san andreas\samp03asvr_R4_win32\filterscripts\Elevador .pwn(38) : error 017: undefined symbol "elevador"

Plz help..

TheNotorius
11/04/2010, 11:35 AM
Make Sure At The Top of Your Script You Have


new elevador;


If That Don't Work

Try Placing it under #include <samp> etc..

Like



#include <samp>

new elevador;


Hope It Work's ;)

Dark734
03/05/2010, 06:51 PM
Thanks , Very helpful to me ! :D

candyboy
14/05/2010, 04:23 PM
How to get cords for moving up and down ????

Nee
17/05/2010, 03:54 AM
If you add something there or there like another gates and make it some complex are be very good
Nice work

FabianoC
17/05/2010, 09:43 PM
#include <samp>

new elevador;



It's Elevator, not elevador. :D

TheNotorius
27/05/2010, 09:15 AM
#include <samp>

new elevador;



It's Elevator, not elevador. :D


Oh, When i Saw Him Type Elevador Thats What i Thought He Wanted =/ xD
I'm not Dumb :D Lol <3

willsuckformoney
14/06/2010, 07:41 AM
C:\Users\Charlie\Desktop\SAMP Server\filterscripts\AdminIsland.pwn(200) : error 017: undefined symbol "gate"
C:\Users\Charlie\Desktop\SAMP Server\filterscripts\AdminIsland.pwn(206) : error 017: undefined symbol "gate"
C:\Users\Charlie\Desktop\SAMP Server\filterscripts\AdminIsland.pwn(212) : error 017: undefined symbol "gate"
C:\Users\Charlie\Desktop\SAMP Server\filterscripts\AdminIsland.pwn(218) : error 017: undefined symbol "gate"
C:\Users\Charlie\Desktop\SAMP Server\filterscripts\AdminIsland.pwn(222) : warning 209: function "OnPlayerCommandText" should return a value
C:\Users\Charlie\Desktop\SAMP Server\filterscripts\AdminIsland.pwn(206) : warning 204: symbol is assigned a value that is never used: "lgate"
C:\Users\Charlie\Desktop\SAMP Server\filterscripts\AdminIsland.pwn(218) : warning 204: symbol is assigned a value that is never used: "rgate"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.


Help xD

foefjoekel
23/10/2011, 07:55 PM
i got this

C:\Users\BB\Desktop\larp.pwn(26405) : warning 202: number of arguments does not match definition
C:\Users\BB\Desktop\larp.pwn(26410) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


2 Warnings.

what to do whit it

AdvancedMapper
29/04/2012, 01:40 AM
Will this make it so that only a certain group can do it?

ReneG
29/04/2012, 02:27 AM
Will this make it so that only a certain group can do it?

It will not make it like that. You need to use variables along with an if statement.