10.11.2013, 01:56
Just a stupid idea I did for the hell of it. When a player dies flowers will spawn and rise out of the ground of their death spot in a few seconds.
pawn Код:
#include <a_samp>
#define MAX_FLOWERS 50
#define FLOWER_OBJECT 325
#define RAISE_DELAY 3000
#define CLEAR_TIME 5000
new Flowers[MAX_FLOWERS] = { -1, ... };
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Flower death by [uL]Pottus");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
for(new i = 0; i < MAX_FLOWERS; i++)
{
if(Flowers[i] != -1) DestroyObject(Flowers[i]);
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetTimerEx("RaiseFlowers", RAISE_DELAY, false, "fff", x, y, z);
return 1;
}
forward RaiseFlowers(Float:x, Float:y, Float:z);
public RaiseFlowers(Float:x, Float:y, Float:z)
{
for(new i = 0; i < MAX_FLOWERS; i++)
{
if(Flowers[i] == -1)
{
Flowers[i] = CreateObject(FLOWER_OBJECT, x, y, z-1.5, 0.0, 0.0, 0.0, 300.0);
MoveObject(Flowers[i], x, y, z-1.0, 0.5);
SetTimerEx("ClearFlowers", CLEAR_TIME, false, "i", i);
return 1;
}
}
return 0;
}
forward ClearFlowers(id);
public ClearFlowers(id)
{
DestroyObject(Flowers[id]);
Flowers[id] = -1;
return 1;
}