SA-MP Forums Archive
Help me With 2 gate's please - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help me With 2 gate's please (/showthread.php?tid=246166)



Help me With 2 gate's please - ultimaterp - 03.04.2011

hey i placed 2
gate's and i want to make some command like /opengate
/closegate to open gate/ close gate
please i started scripting like 1 day ago could u guys make for me a good command make in command?

this CreateObject(5020, 2450.3513183594, -1675.4222412109, 14.183507919312, 0, 0, 312);
and this. CreateObject(10671, 2460.9345703125, -1659.2412109375, 14.169486999512, 0, 0, 357.99499511719);

please can u make a .pwn of this 2.? i will be fine if any help's me


Re: Help me With 2 gate's please - Max_Coldheart - 03.04.2011

What? Ever Heard of "Pawn" compile button? Press F5 or compile to get .pwn file instantly.
Peace out.

This forum requires that you wait 120 seconds between posts. Please try again in 3 seconds.


Re: Help me With 2 gate's please - sansko - 03.04.2011

ehmm start by learning pawn, and by compiling you get the amx file.
on the wiki is one tutorial about gates


Re: Help me With 2 gate's please - C-a-g-e - 03.04.2011

open your script , Put those under {OnGamemodeinit}

https://sampwiki.blast.hk/wiki/CreateObject

And if you'd like to move them

https://sampwiki.blast.hk/wiki/MoveObject


Re: Help me With 2 gate's please - ultimaterp - 03.04.2011

Quote:

if(strcmp(cmdtext, "/gdoor", true) == 0)
{
new string[50];
new movetime = MoveObject(5020, 2450.3513183594, -1675.4222412109, 14.183507919312, 2.00);
format(string, sizeof(string), "Object will finish moving in %d milliseconds", 14000);
SendClientMessage(playerid, 0xFF000000, string);
return 1;
}
return 0;
}
if(strcmp(cmdtext, "/gbigdoor", true) == 0)
{
new string[50];
new movetime = MoveObject(10671, 2460.9345703125, -1659.2412109375, 14.169486999512, 2.00);
format(string, sizeof(string), "Object will finish moving in %d milliseconds", 14000);
SendClientMessage(playerid, 0xFF000000, string);
return 1;
}
return 0;
}

i doesnt compile it says pawn


can any fix this for my? its just 2 gate's thats need be open with command please help me. i know this like's easy for you guys but im new its hard to me


Re: Help me With 2 gate's please - C-a-g-e - 03.04.2011

* remove return 0
* Add " new gate " in the top of the script


Re: Help me With 2 gate's please - ultimaterp - 03.04.2011

C:\Documents and Settings\bunyamin\Bureaublad\Ultimate's Roleplay 0.3c\filterscripts\gangdoors.pwn(59) : error 030: compound statement not closed at the end of file (started at line 47) getting this error....

btw i made little like
Quote:

//=================================//
//Gang Door by Cristiano_Ronaldo =//
//=================================//
#include <a_samp>
new Gate;
new Gate2;

#define KEY_HORN 2
#define COLOR_YELLOW 0xFFFF00AA

#if defined FILTERSCRIPT


public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Gangdoors Created by Cristiano_Ronaldo");
print("--------------------------------------\n");
return 1;
}

public OnFilterScriptExit()
{
return 1;
}
#else

main()
{

}

#endif

new obj; // Somewhere at the top of your script

public OnGameModeInit()
{
obj = CreateObject(5020, 2450.3513183594, -1675.4222412109, 14.183507919312, 0, 0, 312);
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{


if (strcmp("/go", cmdtext, true, 10) == 0)
{
MoveObject(Gate, 2450.3513183594,-1675.4222412109,14.183507919312, 3);
SendClientMessage(playerid, 0xFFFF00AA,"The Gate is opened.Welcome!");
return 1;
}
if (strcmp("/gc", cmdtext, true, 10) == 0)
{
MoveObject(Gate, 2450.3513183594,-1675.4222412109,14.183507919312, 3);
SendClientMessage(playerid, 0xFFFF00AA,"The Gate is closed.bye bye!");
return 1;
}




Re: Help me With 2 gate's please - sansko - 03.04.2011

you need to add one bracket }