Problem with bounty
#1

Hi,im coding a bounty system (if you kill 3+ swat member u get 3 stars level + 1000$ every swat killed).

I done this:

Код:
new Bounty[MAX_PLAYERS];
new BountyKills[MAX_PLAYERS];
OnPlayerConnect

Код:
 Bounty[playerid] = 0;
   	BountyKills[playerid] = 0;
OnPlayerDeath

Код:
 new str[128];
    if(IsPlayerJustice(playerid) && !IsPlayerJustice(killerid))
			{
			BountyKills[killerid]++;
			if(BountyKills[killerid] > 3)
			{
			if(BountyKills[killerid] == 4) Bounty[killerid] = 10000;
			else Bounty[killerid] += 2500;
			GetName(killerid, killername);
			format(str, sizeof(str), "%s (%d) now has a bounty of $%d", killername, killerid, Bounty[killerid]);
			SendClientMessageToAll(COLOR_YELLOW, str);
				}
			}
			if(Bounty[playerid] > 0)
			{
		    GetName(playerid, playername);
			GivePlayerMoney(killerid, Bounty[playerid]);
			format(str, sizeof(str), "You got $%d bounty reward for killing %s (%d)", Bounty[playerid], playername, playerid);
			SendClientMessage(killerid, COLOR_YELLOW, str);
			}
		}
   	}
   	Bounty[playerid] = 0;
   	BountyKills[playerid] = 0;
The IsPlayerJustice function:

Код:
IsPlayerJustice(playerid)
{
	if(gTeam[playerid] == TEAM_SWAT return 1;
	else return 0;
}
And i get tons of errors:

Код:
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2056) : warning 219: local variable "reasonMsg" shadows a variable at a preceding level
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2170) : error 001: expected token: ")", but found "return"
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2201) : error 054: unmatched closing brace ("}")
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2205) : error 021: symbol already defined: "GetPlayerName"
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2207) : error 010: invalid function or declaration
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2209) : error 010: invalid function or declaration
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2211) : error 010: invalid function or declaration
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2215) : error 010: invalid function or declaration
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2219) : error 010: invalid function or declaration
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2223) : error 010: invalid function or declaration
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2227) : error 010: invalid function or declaration
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2231) : error 010: invalid function or declaration
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2235) : error 010: invalid function or declaration
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2239) : error 010: invalid function or declaration
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2243) : error 010: invalid function or declaration
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2247) : error 010: invalid function or declaration
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2251) : error 010: invalid function or declaration
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2255) : error 010: invalid function or declaration
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2259) : error 010: invalid function or declaration
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2263) : error 010: invalid function or declaration
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2267) : error 010: invalid function or declaration
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2271) : error 010: invalid function or declaration
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2275) : error 010: invalid function or declaration
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2279) : error 010: invalid function or declaration
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2283) : error 010: invalid function or declaration
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2287) : error 010: invalid function or declaration
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2291) : error 010: invalid function or declaration

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


26 Errors.
What i done wrong?Thanks!
Reply


Messages In This Thread
Problem with bounty - by Face9000 - 18.12.2010, 19:40
Re: Problem with bounty - by rs.pect - 18.12.2010, 20:02
Re: Problem with bounty - by Lorenc_ - 18.12.2010, 20:06
Re: Problem with bounty - by Face9000 - 18.12.2010, 20:08
Re: Problem with bounty - by rs.pect - 18.12.2010, 20:11
Re: Problem with bounty - by Face9000 - 18.12.2010, 20:18
Re: Problem with bounty - by rs.pect - 18.12.2010, 20:36
Re: Problem with bounty - by Face9000 - 18.12.2010, 20:43
Re: Problem with bounty - by Lorenc_ - 18.12.2010, 20:58
Re: Problem with bounty - by Face9000 - 18.12.2010, 21:01

Forum Jump:


Users browsing this thread: 1 Guest(s)