/airstrike
#1

I have a command for doing a airstrike but i was wondering how to make it only work for someone who has had a 5 fiving streak any ideas
Reply
#2

Код:
new KillStreak[MAX_PLAYERS];

public OnPlayerDeath(playerid, killerid, reason)
{
	if(IsPlayerConnected(killerid))
	{
	  KillStreak[killerid]++;
	  KillStreak[playerid] = 0;
	}
return 1;
}
And then on your /airstrike command just check if(KillStreak[playerid] == 5) or if(KillStreak[playerid] => 5)
Reply
#3

Код:
C:\Program Files\Rockstar Games\GTA San Andreas\my server\filterscripts\airstrike.pwn(653) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\my server\filterscripts\airstrike.pwn(653) : warning 215: expression has no effect
C:\Program Files\Rockstar Games\GTA San Andreas\my server\filterscripts\airstrike.pwn(653) : error 001: expected token: ";", but found "]"
C:\Program Files\Rockstar Games\GTA San Andreas\my server\filterscripts\airstrike.pwn(653) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\my server\filterscripts\airstrike.pwn(653) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
My script use spree not killstreak

Код:
public OnPlayerCommandText(playerid,cmdtext[])
{

	if (strcmp(cmdtext, "/airstrike", true) == 0)
	{
	if(spree[playerid] == 5) or if(spree[playerid] => 5);
	{
		ShowPlayerDialog(playerid,DS,2,"Airstrikes","Vehicle Smasher \nEnemy Wave Attack \nTank Buster \nCarpet Bomb \nNuke \nAir Attack \nAir Bomber \nMegaNuke \nVehicle Nuke \nAircracker bomb \nAirCluster Bomb \nDestructorBomb \nFireCluster \nSplitterMissile \nMOAB ","Ok","Cancel");
		return 1;
	}

	return 0;
}
Reply
#4

You're not supposed to put ; at the end of the if statement.
Reply
#5

Still getting this help would be greatful


Код:
C:\Program Files\Rockstar Games\GTA San Andreas\my server\filterscripts\airstrike.pwn(653) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\my server\filterscripts\airstrike.pwn(653) : warning 215: expression has no effect
C:\Program Files\Rockstar Games\GTA San Andreas\my server\filterscripts\airstrike.pwn(653) : error 001: expected token: ";", but found "]"
C:\Program Files\Rockstar Games\GTA San Andreas\my server\filterscripts\airstrike.pwn(653) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\my server\filterscripts\airstrike.pwn(653) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#6

Lol, I thought you would understand the syntax a little more.

Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
	if (strcmp(cmdtext, "/airstrike", true) == 0)
	{
		if(spree[playerid] == 5)
		{
			ShowPlayerDialog(playerid,DS,2,"Airstrikes","Vehicle Smasher \nEnemy Wave Attack \nTank Buster \nCarpet Bomb \nNuke \nAir Attack \nAir Bomber \nMegaNuke \nVehicle Nuke \nAircracker bomb \nAirCluster Bomb \nDestructorBomb \nFireCluster \nSplitterMissile \nMOAB ","Ok","Cancel");
		}
		return 1;
	}
return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)