SA-MP Forums Archive
/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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /airstrike (/showthread.php?tid=133485)



/airstrike - 02manchestera - 12.03.2010

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


Re: /airstrike - gotenks918 - 12.03.2010

Код:
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)


Re: /airstrike - 02manchestera - 12.03.2010

Код:
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;
}



Re: /airstrike - Correlli - 12.03.2010

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


Re: /airstrike - 02manchestera - 12.03.2010

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.



Re: /airstrike - gotenks918 - 12.03.2010

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;
}