gate problem..help 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: gate problem..help please? (
/showthread.php?tid=194033)
gate problem... /open not working -
Abraham2nd - 28.11.2010
ok guys i made a [MAP] and i released it...all is good!

and i want to update it by adding /open (to open the gate)
but it dont work? here's my code:
Код:
if (strcmp("/open", cmdtext, true, 10) == 0)
{
MoveObject(object,1587.690,-1437.827,4.755, 2.00);
SetTimer("close", 7000, 0);//gate will be closed for 7 seconds
SendClientMessage(playerid,COLOR_LIGHTBLUE,"You are opening a Gate, and will be closed automaticly..");
return 1;}
}
return 0;
}
public close()
{
MoveObject(object,3439.1003417969, -1964.4346923828, 8.7441129684448, 3.00);
return 1;
}
Re: gate problem..help please? -
marinov - 28.11.2010
any errors ?
PS: U gotta forward the timer
Re: gate problem..help please? -
WillyP - 28.11.2010
-.-
There's no created object.
Re: gate problem..help please? -
Miado_Hulk - 28.11.2010
pawn Код:
#include <a_samp>
new object;
forward close();
public close()
{
MoveObject(object,3439.1003417969, -1964.4346923828, 8.7441129684448, 3.00);
}
public OnGameModeInit()
{
object = CreateObject(etc..);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/open", cmdtext, true, 10) == 0)
{
MoveObject(object,1587.690,-1437.827,4.755, 2.00);
SetTimer("close", 7000, 0);//gate will be closed for 7 seconds
SendClientMessage(playerid,COLOR_LIGHTBLUE,"You are opening a Gate, and will be closed automaticly..");
return 1;
}
return 0;
}
Array problem + you forget to add forward+ you forget to add new object and you didn't say that object is CreateObject(...);
Re: gate problem..help please? -
Abraham2nd - 29.11.2010
Sorry i didnt give good info but i did all that before and it didnt do nothing
Re: gate problem..help please? -
[UG]Scripter - 29.11.2010
Tell me exactly what it does / doesnot do....
Re: gate problem..help please? -
Abraham2nd - 29.11.2010
well it doesnt do nothing when i do /open
Re: gate problem..help please? -
[UG]Scripter - 29.11.2010
Can you show me your object = CreateObject(etc..); Code from OnGameModeInit
Re: gate problem..help please? -
Abraham2nd - 29.11.2010
just click the map link on my sig ...i wanna make the gate in that move...
Re: gate problem..help please? -
Abraham2nd - 29.11.2010
http://pastebin.com/nctJbBJv
BTW its a filterscript