18.12.2010, 19:40
Hi,im coding a bounty system (if you kill 3+ swat member u get 3 stars level + 1000$ every swat killed).
I done this:
OnPlayerConnect
OnPlayerDeath
The IsPlayerJustice function:
And i get tons of errors:
What i done wrong?Thanks!
I done this:
Код:
new Bounty[MAX_PLAYERS]; new BountyKills[MAX_PLAYERS];
Код:
Bounty[playerid] = 0; BountyKills[playerid] = 0;
Код:
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;
Код:
IsPlayerJustice(playerid)
{
if(gTeam[playerid] == TEAM_SWAT return 1;
else return 0;
}
Код:
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.


