My gate don't close
#1

Code:
#include <a_samp>

new fbi1;
new fbi2;

forward fb1f();
forward fb2f();

#define Filterscript
#if defined FILTERSCRIPT





public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" FBI - barriere par Akira Kimura");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" FBI - barriere par Akira Kimura");
	print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
  CreateObject(987, -1757.982300, 755.857056, 23.890625, 0.0000, 0.0000, 90.0000);
  CreateObject(987, -1792.423096, 785.014893, 23.890625, 0.0000, 0.0000, 180.0000);
  fbi1 = CreateObject(980, -1786.622559, 785.166626, 26.664017, 0.0000, 0.0000, 0.0000);
  fbi2 = CreateObject(980, -1757.875122, 750.008301, 26.664017, 0.0000, 0.0000, 270.0000);

	return 1;
	

}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/fbiport", cmdtext, true, 10) == 0)
	{
		SendClientMessage(playerid, 0xF4D00FF,"La porte est ouverte pour 7 secondes");
		MoveObject(fbi1, -1798.562012, 785.169556, 26.664017, 4);
		SetTimer("fbi1f", 7, 2);
		return 1;
	}
	if (strcmp("/fbiport2", cmdtext, true, 10) == 0)
	{
		SendClientMessage(playerid, 0xF4D00FF,"La porte est ouverte pour 7 secondes");
		MoveObject(fbi2, -1757.874878, 761.815613, 26.664017, 4);
		SetTimer("fbi2f", 7, 2);
		return 1;
	}
	return 0;
}

public fb1f()
{
  MoveObject(fbi1, -1786.622559, 785.166626, 26.664017, 4);
	return 1;
}

public fb2f()
{
  MoveObject(fbi1, -1757.875122, 750.008301, 26.664017, 4);
	return 1;
}
I do this FS but the gate don't close wuth the timer, why ?


PS : I'm french and I speak Bad English
Reply
#2

You might want to check this:

https://sampwiki.blast.hk/wiki/SetTimer
Reply
#3

SetTimer("fbi1f", 7, 0);
Reply
#4

Quote:
Originally Posted by Klutty
SetTimer("fbi1f", 7, 0);
the 7 stands for barely 1 second 1000 = 1second so change it to

Code:
SetTimer("fbi1f",7000, 0);
Reply
#5

Thanks

EDIT : But the gate don't close
Reply
#6

The bug is in the Timer...
I wait but the gate don't close...

Where is the problem ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)