SA-MP Forums Archive
Need help in Players die in airstrike - 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: Need help in Players die in airstrike (/showthread.php?tid=341261)



Need help in Players die in airstrike - iOmar - 10.05.2012

I amde this airstrike system. I want when player type /airstrike and player when got die in airstrike than the player who type airstike should get score,money and icon in death window.

Please help me.

pawn Код:
CMD:airstrike(playerid,parmas[])
 {
 
    if(GetPlayerScore(playerid) < 2000) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You don't have enough score, you need 2000 score");
    if(GetPlayerMoney(playerid) < 15000) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You don't have enough money.");
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    Airstrike[playerid] = 2;
    SendClientMessage(playerid,0xFF0000AA," AirStrike will Come in 6 sec. Run Away from Red Zone!");
    GivePlayerMoney(playerid,-15000);
   
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string," Server News: %s Has called the Airstrike! ",pName);
    SendClientMessageToAll(0xFF8000FF,string);
   
    Adromada[playerid] = CreateObject(14553,x-55,y,z+75,0.000000,0.000000,90);
    Flare[playerid] = CreateObject(18728,x,y,z-3,0.000000,0.000000,0.000000);
    Timer[playerid] = SetTimerEx("MapIconUpdate",100,true,"d",playerid);
    MoveObject(Adromada[playerid],x+250,y,z+75,29);
    Airstriking[playerid] = 1;
    SetTimerEx("AirstrikeGo",5000,false,"dfffd",playerid,x,y,z,Airstrike[playerid]);
    return 1;
 }
 
forward MapIconUpdate(playerid);
public MapIconUpdate(playerid)
{
    new Float:x,Float:y,Float:z;
    GetObjectPos(Adromada[playerid],x,y,z);
    SetPlayerMapIcon(playerid,0,x-55,y,z+75,5,0xFF0000AA);
}

forward AirstrikeGo3(playerid,Float:x,Float:y,Float:z,type);
public AirstrikeGo3(playerid,Float:x,Float:y,Float:z,type)
{
        Airstriking[playerid] = 0;
        CreateExplosion(x,y+5,z,7,5);
        CreateExplosion(x,y+6,z,7,5);
        CreateExplosion(x,y+7,z,7,5);
        CreateExplosion(x,y+8,z,7,5);
        return 1;
}

forward AirstrikeGo2(playerid,Float:x,Float:y,Float:z,type);
public AirstrikeGo2(playerid,Float:x,Float:y,Float:z,type)
{
        CreateExplosion(x,y+5,z,7,5);
        CreateExplosion(x,y+6,z,7,5);
        CreateExplosion(x,y+7,z,7,5);
        CreateExplosion(x,y+8,z,7,5);
        return 1;
       
}

forward AirstrikeGo(playerid,Float:x,Float:y,Float:z,type);
public AirstrikeGo(playerid,Float:x,Float:y,Float:z,type)
{
         Airstriking[playerid] = 0;
         DestroyObject(Flare[playerid]);
         RemovePlayerMapIcon(playerid,0);
         KillTimer(Timer[playerid]);
         DestroyObject(Adromada[playerid]);
         CreateExplosion(x,y,z,7,5);
         Airstrike[playerid] = 0;
         Airstriking[playerid] = 0;
         return 1;
         
}