Can't move the gate - 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)
+--- Thread: Can't move the gate (
/showthread.php?tid=296865)
Can't move the gate -
[PS]NightborN - 13.11.2011
here's the code
Код:
#define FILTERSCRIPT
#include <a_samp>
new imafia;
public OnFilterScriptInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
imafia = CreateObject(980,1245.68627930,-768.25524902,93.69370270,0.00000000,0.00000000,0.00000000); //object(airportgate) (1)
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/im1", cmdtext, true, 10) == 0)
{
MoveObject(imafia,1245.27880859,-768.20977783,93.69495392, 2.00);
SetTimer("imafia1", 4000, 0);//gate will be closed for 7 seconds
SendClientMessage(playerid,0xFF7F50AA,"xaxaax!..");
return 1;}
return 0;
}
Re: Can't move the gate -
Tanush123 - 13.11.2011
strange, try changing that to an automatic gate
Re: Can't move the gate -
Sascha - 13.11.2011
change
if (strcmp("/im1", cmdtext, true, 10) == 0)
to
if (strcmp("/im1", cmdtext, true, 4) == 0)
Re: Can't move the gate -
[PS]NightborN - 13.11.2011
work but cant close :d
Re: Can't move the gate -
Tanush123 - 13.11.2011
-__- change
pawn Код:
SetTimer("imafia1", 4000, 0);
to
pawn Код:
SetTimerEx("imafia1gate", 4000, 0,"u",playerid);
Then in the bottom add
pawn Код:
forward imafia1gate(playerid);
public imafia1gate(playerid)
{
MoveObject(imafia,(X of where you wanna move to),(Y of where you wanna move to),(Z of where you wanna move to),(Speed));
return 1;
}