08.03.2013, 20:36
(
Last edited by Jhony_Blaze; 06/10/2013 at 03:18 PM.
)
Hello,I am sure that there are many of you that know already to make this script in less then 5 minutes but maybe there are new scripters too who can't script a movable gate so this will kinda be like a tutorial.
First of all add this on your GM/script top
Second add this under "#include <a_samp>"
So it would look like this
3rd, name your gate like this "new TestGate1;" (you can choose what name you want but you have to use "Gate") under
So it would look like this
4th add these to "public OnGameModeInit ()" so it would look like this
5th add these to "public OnPlayerCommandText(playerid, cmdtext[])" so it would look like this
At the end this is how all the script needs to look
Thats all peace
First of all add this on your GM/script top
Code:
#include <a_samp>
Code:
#define COLOR_RED 0xff0000FF
Code:
#include <a_samp> #define COLOR_RED 0xff0000FF
Code:
#include <a_samp>
Code:
#include <a_samp> #define COLOR_RED 0xff0000FF new TestGate1;
Code:
public OnGameModeInit () { TestGate1 = CreateObject(Add your closed gate coordinates here); //Gate Object Closed return 1; }
Code:
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; }
At the end this is how all the script needs to look
Code:
#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; }