SA-MP Forums Archive
Timer? - 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: Timer? (/showthread.php?tid=588019)



Timer? - alexanderjb918 - 04.09.2015

Код:
Function CarryShell(playerid,id)
{
 	new Float:Pos[3];
	GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);

	CarryShells[playerid] = id;

	ShellInfo[id][sPos][0] = 0;
	ShellInfo[id][sPos][1] = 0;
	ShellInfo[id][sPos][2] = 0;

	DestroyDynamic3DTextLabel(ShellInfo[id][sText]);

	return 1;
}
Is there a way i can make it so every shell after 10 minutes of spawned gets removed?


Re: Timer? - Fancy - 04.09.2015

Код:
forward DestroyShell(playerid);

public DestroyShell(playerid)
{
 	new Float:Pos[3];
	GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);

	CarryShells[playerid] = playerid;

	ShellInfo[playerid][sPos][0] = 0;
	ShellInfo[playerid][sPos][1] = 0;
	ShellInfo[playerid][sPos][2] = 0;

	DestroyDynamic3DTextLabel(ShellInfo[id][sText]);
        return 1;
}

public OnPlayerSpawn(playerid)
{
    SetTimerEx("DestroyShell", 1000*60*10, false, "i", playerid);
    return 1;
}
//I dident tested it
//I dont know exactly what you want to do


Re: Timer? - alexanderjb918 - 04.09.2015

I want all my spawned blood / gun shells to despawn every 10 minutes


Re: Timer? - Variable™ - 04.09.2015

Код:
SetTimerEx("DestroyShell", 1000*60*10, false, "i", playerid);
to:
Код:
SetTimer("DestroyShell", 1000*60*10, true);