Killstreaks: HELP please?
#1

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);
                }
            }
        }
Reply
#2

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!");
}
Reply
#3

Didn't work :/
Reply
#4

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!");
}
Reply
#5

Rep+ thanks for the help
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)