Timer?
#1

Код:
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?
Reply
#2

Код:
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
Reply
#3

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)