Weird :s - 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: Weird :s (
/showthread.php?tid=89640)
Weird :s -
Kyle - 03.08.2009
This code works fine
Quote:
if(gTeam[playerid] == TEAM_PRES && TEAMPRES == playerid)
{
new string[128];
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
format(string, sizeof(string),"%s(%d) Is No Longer President",pname,playerid);
SendClientMessageToAll(COLOR_TEAMYELLOW, string);
GameTextForAll("~b~The President Has Been Killed In An Accident!", 8000, 5);
return 1;
}
|
But as soon as i add
&& gTeam[killerid] != TEAM_TERR
into the statement it dont work
Re: Weird :s -
Kyle - 03.08.2009
The first code works but when i add the second bit it dont it stops working and no errors
Re: Weird :s -
Kyle - 03.08.2009
Nooo i mean it works ingame but wen i add it stops working ingame pawno.exe is fine
Re: Weird :s -
Joe Staff - 03.08.2009
That's because if a person is killed by no one(falling/suicide) the killerid=255, and you gTeam[] thing can only go up to MAX_PLAYERS (199 + the number 0) so make sure you put that into account.