Код:
CMD:placefirework(playerid, params[])
{
if(GetPVarInt(playerid, "IsInArena") >= 0)
{
SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this while being in an arena!");
return 1;
}
if(WatchingTV[playerid] != 0) {
SendClientMessageEx(playerid, COLOR_GREY, "You can not do this while watching TV!");
return 1;
}
if(GetPVarInt(playerid, "Injured") == 1 || GetPVarInt(playerid, "Hospital") == 1 || IsPlayerInAnyVehicle(playerid))
{
SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this right now.");
return 1;
}
//if(RocketExplosions[playerid] != 0)
//{
// SendClientMessageEx(playerid, COLOR_WHITE, "You are already using another firework!");
// return 1;
//}
if (PlayerInfo[playerid][pVW] != 0 || PlayerInfo[playerid][pInt] != 0)
{
SendClientMessageEx(playerid, COLOR_WHITE, "You can't launch fireworks indoors!");
return 1;
}
if(PlayerInfo[playerid][pFirework] > 0 || PlayerInfo[playerid][pAdmin] >= 4)
{
if (PlayerInfo[playerid][pAdmin] < 4)
{
PlayerInfo[playerid][pFirework]--;
}
new string[128];
format(string, sizeof(string), "%s has placed a firework which will go off in 15 seconds!", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
ApplyAnimation(playerid,"BOMBER","BOM_Plant_Crouch_In", 4.0, 0, 0, 0, 0, 0, 1);
x += (2 * floatsin(-a, degrees));
y += (2 * floatcos(-a, degrees));
Rocket[playerid] = CreateDynamicObject(3786, x, y, z, 0, 90, 0);
RocketLight[playerid] = CreateDynamicObject(354, x, y, z + 1, 0, 0, 0);
RocketSmoke[playerid] = CreateDynamicObject(18716, x, y, z - 4, 0, 0, 0);
SetPVarFloat(playerid,"fxpos",x);
SetPVarFloat(playerid,"fypos",y);
SetPVarFloat(playerid,"fzpos",z);
RocketExplosions[playerid] = 0;
SetTimerEx("Firework", 10000, 0, "ii", playerid, TYPE_COUNTDOWN);
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "You don't have any fireworks!");
}
return 1;
}
Or you can make an variable or Pvar that, the firework is placed.