/airstrike help.
#1

Alright, so i'v made this /airstrike command and need it to be available when a player reaches a kill streak of 5 and they can only use it once.

my code, i'v got the explosion done and it works nicely, now i just need to make it so a player can only use it once, and once they get a +5 kill streak.

If possible could you add a //and what the lines do so i can learn/remember this for later, thank you.
Код:
if (strcmp("/airstrike", cmdtext, true, 5) == 0)
    {
		new Float:x, Float:y, Float:z ;
		GetPlayerPos( playerid, Float:x, Float:y, Float:z );
		CreateExplosion(Float:x+10, Float:y, Float:z, 8,10.0);
		CreateExplosion(Float:x-10, Float:y, Float:z, 8,10.0);
		CreateExplosion(Float:x, Float:y+10, Float:z, 8,10.0);
		CreateExplosion(Float:x, Float:y-10, Float:z, 8,10.0);
		CreateExplosion(Float:x+10, Float:y+10, Float:z, 8,10.0);
		CreateExplosion(Float:x-10, Float:y+10, Float:z, 8,10.0);
		return CreateExplosion(Float:x-10, Float:y-10, Float:z, 8,10.0);
	}
Reply
#2

sorry for double post

Don't worry about isplayerinrangeofpoint, i'v fixed it.
Reply
#3

I'm not going to make the whole code for you, but i'm going to help u out with a few keywords
pawn Код:
new PlayerKillStreak[MAX_PLAYERS]
//////////////
OnPlayerDeath()
PlayerKillStreak[killerid]++
PlayerKillStreak[deadid] = 0;
//////////////////////

OnPlayerCommandText(blabla)
if (strcmp("/airstrike", cmdtext, true, 5) == 0)
    {
      if(PlayerKillStreak[playerid] < 5) return SendClientMessage(playerid,COLOR_....,"Your killstreak is too low!");
      PlayerKillStreak[playerid]-5;
        new Float:x, Float:y, Float:z ;
        GetPlayerPos( playerid, Float:x, Float:y, Float:z );
        CreateExplosion(Float:x+10, Float:y, Float:z, 8,10.0);
        CreateExplosion(Float:x-10, Float:y, Float:z, 8,10.0);
        CreateExplosion(Float:x, Float:y+10, Float:z, 8,10.0);
        CreateExplosion(Float:x, Float:y-10, Float:z, 8,10.0);
        CreateExplosion(Float:x+10, Float:y+10, Float:z, 8,10.0);
        CreateExplosion(Float:x-10, Float:y+10, Float:z, 8,10.0);
        return CreateExplosion(Float:x-10, Float:y-10, Float:z, 8,10.0);

    }
Reply
#4

Quote:
Originally Posted by Bessensap
Посмотреть сообщение
I'm not going to make the whole code for you, but i'm going to help u out with a few keywords
pawn Код:
new PlayerKillStreak[MAX_PLAYERS]
//////////////
OnPlayerDeath()
PlayerKillStreak[killerid]++
PlayerKillStreak[deadid] = 0;
//////////////////////

OnPlayerCommandText(blabla)
if (strcmp("/airstrike", cmdtext, true, 5) == 0)
    {
      if(PlayerKillStreak[playerid] < 5) return SendClientMessage(playerid,COLOR_....,"Your killstreak is too low!");
      PlayerKillStreak[playerid]-5;
        new Float:x, Float:y, Float:z ;
        GetPlayerPos( playerid, Float:x, Float:y, Float:z );
        CreateExplosion(Float:x+10, Float:y, Float:z, 8,10.0);
        CreateExplosion(Float:x-10, Float:y, Float:z, 8,10.0);
        CreateExplosion(Float:x, Float:y+10, Float:z, 8,10.0);
        CreateExplosion(Float:x, Float:y-10, Float:z, 8,10.0);
        CreateExplosion(Float:x+10, Float:y+10, Float:z, 8,10.0);
        CreateExplosion(Float:x-10, Float:y+10, Float:z, 8,10.0);
        return CreateExplosion(Float:x-10, Float:y-10, Float:z, 8,10.0);

    }
Cheers, worked nicely thanks.
Reply
#5

No prob
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)