SA-MP Forums Archive
Killstreaks: HELP please? - 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: Killstreaks: HELP please? (/showthread.php?tid=282515)



Killstreaks: HELP please? - BigAl - 11.09.2011

i have made it so when you get a 5 killstreak, you get an airstrike... but you can use it more than once... i wanna make it so when you use it once... you can't use it again without dying and having to restart the killstreak

pawn Код:
case 6:
        {
            if(!response)
            {
                SendClientMessage(playerid, C_RED, "You didn't call a killstreak in");
                return 1;
            }
            switch(listitem)
            {
                case 0:
                {
                    CreateExplosion(x, y, z+10, 12, 10.0);
                    CreateExplosion(x, y+10, z+10, 12, 10.0);
                    CreateExplosion(x+10, y+5, z+3, 12, 10.0);
                    CreateExplosion(x+5, y+3, z+1, 12, 10.0);
                    CreateExplosion(x+3, y+2, z, 12, 10.0);
                    CreateExplosion(x+1, y+1, z, 12, 10.0);
                }
            }
        }



Re: Killstreaks: HELP please? - AeroBlast - 11.09.2011

pawn Код:
new HasCalledAirstrike[MAX_PLAYERS]; //On top of your script

public OnPlayerSpawn(playerid)
{
    HasCalledAirstrike[playerid] = 0;
    return 1;
}

case 6:
{
    if(!response)
    {
        SendClientMessage(playerid, C_RED, "You didn't call a killstreak in");
        return 1;
    }
    if(HasCalledAirstrike[playerid] == 0)
    {
        switch(listitem)
        {
            case 0:
            {
                CreateExplosion(x, y, z+10, 12, 10.0);
                CreateExplosion(x, y+10, z+10, 12, 10.0);
                CreateExplosion(x+10, y+5, z+3, 12, 10.0);
                CreateExplosion(x+5, y+3, z+1, 12, 10.0);
                CreateExplosion(x+3, y+2, z, 12, 10.0);
                CreateExplosion(x+1, y+1, z, 12, 10.0);
            }
        }
    }
    else SendClientMessage(playerid,0xFF0000FF,"You already called in an Airstrike in this live!");
}



Re: Killstreaks: HELP please? - BigAl - 11.09.2011

Didn't work :/


Re: Killstreaks: HELP please? - AeroBlast - 11.09.2011

Whoops, I fail...
pawn Код:
new HasCalledAirstrike[MAX_PLAYERS]; //On top of your script

public OnPlayerSpawn(playerid)
{
    HasCalledAirstrike[playerid] = 0;
    return 1;
}

case 6:
{
    if(!response)
    {
        SendClientMessage(playerid, C_RED, "You didn't call a killstreak in");
        return 1;
    }
    if(HasCalledAirstrike[playerid] == 0)
    {
        switch(listitem)
        {
            case 0:
            {
                CreateExplosion(x, y, z+10, 12, 10.0);
                CreateExplosion(x, y+10, z+10, 12, 10.0);
                CreateExplosion(x+10, y+5, z+3, 12, 10.0);
                CreateExplosion(x+5, y+3, z+1, 12, 10.0);
                CreateExplosion(x+3, y+2, z, 12, 10.0);
                CreateExplosion(x+1, y+1, z, 12, 10.0);
                HasCalledAirstrike[playerid]++;
            }
        }
    }
    else SendClientMessage(playerid,0xFF0000FF,"You already called in an Airstrike in this live!");
}



Re: Killstreaks: HELP please? - BigAl - 11.09.2011

Rep+ thanks for the help