#include <a_samp>
#define COLOR_RED 0xff0000FF
#include <a_samp> #define COLOR_RED 0xff0000FF
#include <a_samp>
#include <a_samp> #define COLOR_RED 0xff0000FF new TestGate1;
public OnGameModeInit () { TestGate1 = CreateObject(Add your closed gate coordinates here); //Gate Object Closed return 1; }
public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp(cmdtext, "/open", true) == 0) { SendClientMessage(playerid, COLOR_RED,"The gate is open"); //You can change the color on whatever you want,but if you change the color you also have to edit the " #define COLOR_RED 0xff0000FF " on top of your script. MoveObject(TestGate1, add your gate opened coordinates, 1); //The 1 is the gates speed return 1; } if(strcmp(cmdtext, "/close", true) == 0) { SendClientMessage(playerid, COLOR_RED,"The gate is closed"); MoveObject(TestGate1, add your closed gate coordinates, 1); //The 1 is the gates speed return 1; } return 0; }
#include <a_samp> #define COLOR_RED 0xff0000FF new TestGate1; public OnGameModeInit () { TestGate1 = CreateObject(968,2462.5000000,-1662.1999512,13.0000000,0.0000000,270.0000000,270.0000000); //Gate Object Closed return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp(cmdtext, "/open", true) == 0) { SendClientMessage(playerid, COLOR_RED,"The gate is open"); MoveObject(TestGate1, 2462.5000000,-1662.1999512,13.0000000, 1); //Does are random numbers I just made them for this tutorial. return 1; } if(strcmp(cmdtext, "/close", true) == 0) { SendClientMessage(playerid, COLOR_RED,"The gate is closed"); MoveObject(TestGate1, 2462.5000000,-1662.1999512,13.0000000, 1); //Does are random numbers I just made them for this tutorial. return 1; } return 0; }
Code:
public OnGameModeInit () { TestGate1 = CreateObject(Add your closed gate coordinates here); //Gate Object Closed return 1; } } |