Movable Gate help
#1

Hello,I am new in scripting but I would really like to learn at least to do a movable gate,I would appreciate a bit of help.This is what I've done and I think its messed up.

Код:
#include <a_samp>
new Gate;

public OnGameModeInit()
{
Gate = CreateObject(968,2467.5000000,-1663.1999512,13.1000004,0.0000000,270.0000000,271.9999695); 
}
public OnPlayerCommandText(playerid, cmdtext[])
}
if(strcmp(cmd, "/opengate", true) == 0)
{
MoveObject(Gate, 2467.5000000,-1663.1999512,13.1000004,0.0000000, 1);

SendClientMessage(playerid, COLOR_YELLOW, "The gate is open.");
return 1;
}
if(strcmp(cmd, "/closegate", true) == 0)
{
MoveObject(Gate, 2467.5000000,-1663.1999512,13.1000004, 1);

SendClientMessage(playerid, COLOR_YELLOW, "The gate is closed.");
Can someone give me all necessary to make a movable gate and all what I need?

I used ID 966 and ID 968 its the gate from LSPD garage enterance.
Reply
#2

Код:
#include <a_samp>
new Gate;

public OnGameModeInit()
{
Gate = CreateObject(968,2467.5000000,-1663.1999512,13.1000004,0.0000000,270.0000000,271.9999695); 
}
public OnPlayerCommandText(playerid, cmdtext[])
}
if(strcmp(cmd, "/opengate", true) == 0)
{
MoveObject(Gate, 2467.5000000,-1663.1999512,13.1000004,0.0000000, 1);
}
SendClientMessage(playerid, COLOR_YELLOW, "The gate is open.");
return 1;
}
if(strcmp(cmd, "/closegate", true) == 0)
{
MoveObject(Gate, 2467.5000000,-1663.1999512,13.1000004, 1);
}
SendClientMessage(playerid, COLOR_YELLOW, "The gate is closed.");
Try this.
Reply
#3

Change

PHP код:
if(strcmp(cmd"/opengate"true) == 0)
{
      
MoveObject(Gate2467.5000000,-1663.1999512,13.1000004,0.00000001);
      
SendClientMessage(playeridCOLOR_YELLOW"The gate is open.");
      return 
1;

to

PHP код:
if(strcmp(cmd"/opengate"true) == 0)
{
      
MoveObject(Gate2467.5000000,-1663.1999512,13.1000004,1);
      
SendClientMessage(playeridCOLOR_YELLOW"The gate is open.");
      return 
1;

Defaut Forme MoveObject(Gate, x,Y,Z,Speed,RX,RY,RZ);

RX,RY,RZ Not nessesery for Normal Gate ( ( up down Right Left) Gates)
Reply
#4

https://sampwiki.blast.hk/wiki/SetObjectRot
Reply
#5

Still nothing,I get bunch of errors..
Reply
#6

PHP код:
C:\Documents and Settings\Major\My Documents\Downloads\server test\gamemodes\rivershell.pwn(17) : error 029invalid expressionassumed zero
C
:\Documents and Settings\Major\My Documents\Downloads\server test\gamemodes\rivershell.pwn(17 -- 18) : warning 215expression has no effect
C
:\Documents and Settings\Major\My Documents\Downloads\server test\gamemodes\rivershell.pwn(18) : error 001expected token";"but found "if"
C:\Documents and Settings\Major\My Documents\Downloads\server test\gamemodes\rivershell.pwn(22) : error 021symbol already defined"SendClientMessage"
C:\Documents and Settings\Major\My Documents\Downloads\server test\gamemodes\rivershell.pwn(23) : error 010invalid function or declaration
C
:\Documents and Settings\Major\My Documents\Downloads\server test\gamemodes\rivershell.pwn(26) : error 010invalid function or declaration
C
:\Documents and Settings\Major\My Documents\Downloads\server test\gamemodes\rivershell.pwn(30) : error 021symbol already defined"SendClientMessage"
C:\Documents and Settings\Major\My Documents\Downloads\server test\gamemodes\rivershell.pwn(31) : error 010invalid function or declaration
C
:\Documents and Settings\Major\My Documents\Downloads\server test\gamemodes\rivershell.pwn(14) : warning 204symbol is assigned a value that is never used"Gate"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
7 Errors

These are the errors what i get...
Reply
#7

Copy my one and put your Coords in:

Quote:

#include <a_samp>
new gate1;

----------------------------------
Quote:

public OnFilterScriptInit()
{
gate1 = CreateObject(971,-1184.54418945,-996.06542969,130.38134766,0.0,0.0,270.0);
return 1;

-----------------------------------
Quote:

public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext,"/gateopen",true)==0) //gate1open
{
MoveObject(gate1, -1184.2901611328, -996.14276123047, 123.37306976318 , 5.00);
return 1;
}
if(strcmp(cmdtext,"/gateclose",true)==0) //gate1close
return 1;
}
return 0;
}

Reply
#8

If you get anymore errors message me, ill help you.
Reply
#9

thx mate that was helpful +rep
Reply
#10

No problem, glad i could help, unfortunately you cant rep till you have 50 posts D:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)