SA-MP Forums Archive
2 gates open different ways??? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: 2 gates open different ways??? (/showthread.php?tid=604972)



2 gates open different ways??? - Bulgaria - 12.04.2016

Ok i just finish my Army base who i will give you all but first i need to make gates sooo im done with this so there it is
PHP код:
CreateObject(986,1209.7000000,-1840.7000000,14.2000000,0.0000000,0.0000000,180.0000000); //object(gate_autol) (1)
CreateObject(985,1217.6000000,-1840.7000000,14.2000000,0.0000000,0.0000000,180.0000000); //object(gate_autor) (1) 
Ok soo i need help again... How to make "AutoR" gate move to right and "AutoL" gate move to Left


Re: 2 gates open different ways??? - -CaRRoT - 12.04.2016

Open your map editor once again, move both gates to the opening locations you desire & then save the objects and use the coordinates with MoveObject to make them move.


Re: 2 gates open different ways??? - Bulgaria - 12.04.2016

(y) this will be my frist time will i make gates open different ways to now i make only to one way i just want to be sure is like to make like one gate


Re: 2 gates open different ways??? - -CaRRoT - 12.04.2016

Quote:
Originally Posted by Bulgaria
Посмотреть сообщение
(y) this will be my frist time will i make gates open different ways to now i make only to one way i just want to be sure is like to make like one gate
I am not really sure of what you're trying to say but I think the answer is yes, its the same as making one gate but the only difference is 2 objects in 2 different locations.


Re: 2 gates open different ways??? - Bulgaria - 12.04.2016

Ok what now??
PHP код:
#if defined FILTERSCRIPT
new gateone;
new 
gatetwo
PHP код:
//Gates
    
gateone CreateObject(986,1209.7000000,-1840.7000000,14.2000000,0.0000000,0.0000000,180.0000000);
    
gatetwo CreateObject(985,1217.6000000,-1840.7000000,14.2000000,0.0000000,0.0000000,180.0000000);
    return 
1
PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp)cmdtext"/oag"true) == 0) {
    
MoveObject(gateone1205.7000000,-1840.7000000,14.20000001);
    
MoveObject(gateone1221.6000000,-1840.7000000,14.20000001);
    return 
1;
    }
    
    if(
strcmp)cmdtext"/cag"true) == 0) {
    
MoveObject(gateone1209.7000000,-1840.7000000,14.20000001);
    
MoveObject(gateone1217.6000000,-1840.7000000,14.20000001);
    return 
1;
    }
    return 
0;




Re: 2 gates open different ways??? - -CaRRoT - 12.04.2016

Change the "gateone" variable in both of these lines (2nd in each CMD) to "gatetwo" to make the 2nd gate move.

Код:
MoveObject(gateone, 1221.6000000,-1840.7000000,14.2000000, 1);
and
Код:
MoveObject(gateone, 1217.6000000,-1840.7000000,14.2000000, 1);
gateone -> gatetwo


Re: 2 gates open different ways??? - Bulgaria - 12.04.2016

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp)cmdtext"/oag"true) == 0) {
    
MoveObject(gateone1205.7000000,-1840.7000000,14.20000001);
    
MoveObject(gatetwo1221.6000000,-1840.7000000,14.20000001);
    return 
1;
    }
    
    if(
strcmp)cmdtext"/cag"true) == 0) {
    
MoveObject(gateone1209.7000000,-1840.7000000,14.20000001);
    
MoveObject(gatetwo1217.6000000,-1840.7000000,14.20000001);
    return 
1;
    }
    return 
0;

PHP код:
C:\Users\Борисов\Desktop\BG RP Server\gamemodes\BG1.2.pwn(281) : error 017undefined symbol "gateone"
C:\Users\Борисов\Desktop\BG RP Server\gamemodes\BG1.2.pwn(282) : error 017undefined symbol "gatetwo"
C:\Users\Борисов\Desktop\BG RP Server\gamemodes\BG1.2.pwn(419) : error 076syntax error in the expression, or invalid function call
C
:\Users\Борисов\Desktop\BG RP Server\gamemodes\BG1.2.pwn(419) : warning 215expression has no effect
C
:\Users\Борисов\Desktop\BG RP Server\gamemodes\BG1.2.pwn(419) : warning 215expression has no effect
C
:\Users\Борисов\Desktop\BG RP Server\gamemodes\BG1.2.pwn(419) : warning 215expression has no effect
C
:\Users\Борисов\Desktop\BG RP Server\gamemodes\BG1.2.pwn(419) : error 001expected token";"but found ")"
C:\Users\Борисов\Desktop\BG RP Server\gamemodes\BG1.2.pwn(419) : error 029invalid expressionassumed zero
C
:\Users\Борисов\Desktop\BG RP Server\gamemodes\BG1.2.pwn(419) : fatal error 107too many error messages on one line

Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase


6 Errors




Re: 2 gates open different ways??? - -CaRRoT - 12.04.2016

I recommend switching to a different command processor. However, your're using an incorrect strcmp syntax.

Код:
if(strcmp(cmdtext, "/oag", true) == 0)
is how the command should look.


Re: 2 gates open different ways??? - Bulgaria - 12.04.2016

o yeah i see it ...


Re: 2 gates open different ways??? - DavidGravelli - 12.04.2016

pawn Код:
new gateone;
new gatetwo
Hope it get working Try add that in your script.pwn