Timer issues....
#1

Ok, real simple problem here. I wanna set a timer to do something in a given time (obviously...)

at the top I put:
Код:
forward Time();
Then here I put:
Код:
DropFlag(playerid)
{
	new str[256];
    if(PlayerStat[playerid][pflag])
	{
	    new Float:x,Float:y,Float:z;
	    GetPlayerPos(playerid,x,y,z);
	    DestroyObject(flag[PlayerStat[playerid][pflag]]);
		format(str,sizeof(str),"[%d]%s has dropped the flag! It will return to its orgin in 30 seconds.",playerid,PlayerName(playerid));
		SendClientMessageToAll(GetPlayerColor(playerid),str);
		dflag[PlayerStat[playerid][pflag]] = CreatePickup(2993,1,x,y,z,0);
		PlayerStat[playerid][pflag]=0;
		SetTimer("Time",3000,0);
	}
	return 1;
}
Then here goes..:
Код:
public Time()
{
	DropTimer();
}

DropTimer()
{
	if(drop[1])
	{
   		DestroyPickup(dflag[1]);
   		lsflag1 = CreatePickup(2993,1,2528.657715, -1666.986938, 14.863762);
                //code continues and is ended with no syntax errors, etc...........
The problem is simple.......THIS DOESN'T HAPPEN IN THE GAME....why?
Reply
#2

SetTimer("DropTimer",1000,1); ?
Reply
#3

Fixed........apperently my if statement weren't true to begin with. "Drop" wasn't assigned anything yet therefore it was still set to 0 xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)