Array index out of bonus
#10

Quote:
Originally Posted by raydx
Посмотреть сообщение
Problem is here:

Код:
new turf = GetPlayerTurf(playerid), faction = PlayerInfo[playerid][pMember], string[128], players;
        if(turf == 0 || turf >= MAX_TURFS) return SS(playerid, COLOR_WHITE, "Nu esti pe turf.", "You are not on a turf.");
        if(TurfInfo[turf][zOwned] == faction) return SS(playerid, COLOR_WHITE, "Nu iti poti ataca propriul turf.", "You can't attack your own turf.");
GetPlayerTurf returns -1, not 0.


So, change this:


Код:
if(turf == 0 || turf >= MAX_TURFS) return SS(playerid, COLOR_WHITE, "Nu esti pe turf.", "You are not on a turf.");
To this:

Код:
if(turf == -1 || turf >= MAX_TURFS) return SS(playerid, COLOR_WHITE, "Nu esti pe turf.", "You are not on a turf.");
I have changed with < 1.
Thanks bro!
Reply


Messages In This Thread
Array index out of bonus - by RedGun2015 - 15.12.2017, 15:54
Re: Array index out of bonus - by Konstantinos - 15.12.2017, 16:49
Re: Array index out of bonus - by RedGun2015 - 15.12.2017, 17:37
Re: Array index out of bonus - by Konstantinos - 15.12.2017, 18:42
Re: Array index out of bonus - by None1337 - 15.12.2017, 19:22
Re: Array index out of bonus - by RedGun2015 - 15.12.2017, 19:34
Re: Array index out of bonus - by Konstantinos - 16.12.2017, 08:59
Re: Array index out of bonus - by RedGun2015 - 16.12.2017, 10:35
Re: Array index out of bonus - by raydx - 16.12.2017, 10:59
Re: Array index out of bonus - by RedGun2015 - 16.12.2017, 14:03

Forum Jump:


Users browsing this thread: 1 Guest(s)