SA-MP Forums Archive
Help Gzone Error - 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)
+--- Thread: Help Gzone Error (/showthread.php?tid=473257)



Help Gzone Error - proSeryoga - 02.11.2013

help pls
tutorial: https://sampforum.blast.hk/showthread.php?tid=276352
Quote:

public OnPlayerDeath(playerid, killerid, reason)
{
if(IsPlayerConnected(killerid) && gTeam[playerid] != gTeam[killerid])
{
new zoneid = GetPlayerZone(playerid);
if(zoneid != -1 && ZoneInfo[zoneid][zTeam] == gTeam(playerid))
{
ZoneDeaths[zoneid]++;
if(ZoneDeaths[zoneid] == MIN_DEATHS_TO_START_WAR)
{
ZoneDeaths[zoneid] = 0;
ZoneAttacker[zoneid] = gTeam(killerid);
ZoneAttackTime[zoneid] = 0;
GangZoneFlashForAll(ZoneID[zoneid], GetTeamZoneColor(ZoneAttacker[zoneid]));
}
}
}
return 1;
}

Quote:

\gamemodes\dm.pwn(1069) : error 012: invalid function call, not a valid address
\gamemodes\dm.pwn(1069) : warning 215: expression has no effect
\gamemodes\dm.pwn(1069) : error 001: expected token: ";", but found ")"
\gamemodes\dm.pwn(1069) : error 029: invalid expression, assumed zero
\gamemodes\dm.pwn(1069) : 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: Help Gzone Error - xF4Life - 02.11.2013

This is your error
Код:
ZoneAttacker[zoneid] = gTeam(killerid);
// You have "gTeam(killerid); correct way is:- "gTeam[killerid]"
Fix code:-
Код:
if(IsPlayerConnected(killerid) && gTeam[playerid] != gTeam[killerid])
{
new zoneid = GetPlayerZone(playerid);
if(zoneid != -1 && ZoneInfo[zoneid][zTeam] == gTeam(playerid)) 
{
ZoneDeaths[zoneid]++;
if(ZoneDeaths[zoneid] == MIN_DEATHS_TO_START_WAR)
{
ZoneDeaths[zoneid] = 0;
ZoneAttacker[zoneid] = gTeam[killerid];
ZoneAttackTime[zoneid] = 0;
GangZoneFlashForAll(ZoneID[zoneid], GetTeamZoneColor(ZoneAttacker[zoneid]));
}
}
}