Quote:
Originally Posted by Juvanii
PHP код:
stock OwnedTurfs2(teamid) //calling the function with a team id
{
new turf; //new variable 'turf' which has a value of 0
for (new i = 0; i < MAX_TURFS; i++) //looping from 0 to max turfs number
{
if(turfs[i][TurfOwner] == teamid) //if the loop found that turf owner = teamid (i really don't know how would an owner name will equal a number)
{
TeamInfo[teamid][ TeamTurfs ] = 0 // reseting team turfs to 0
TeamInfo[teamid][ TeamTurfs ]++; // add +1 to team turfs after resetting it to 0 (which make no sense)
}
}
return turf; //return 0 which is variable 'turf' as u havent change the value of it
}
|
(This loop isn't written by me, I'm trying to fix a really buggy gamemode.)
PHP код:
stock OwnedTurfs2(teamid) //calling the function with a team id
{
new turf; //new variable 'turf' which has a value of 0
for (new i = 0; i < MAX_TURFS; i++) //looping from 0 to max turfs number
{
if(turfs[i][TurfOwner] == teamid) //if the loop found that turf owner = teamid (i really don't know how would an owner name will equal a number)
{
TeamInfo[teamid][ TeamTurfs ]++; // add +1 to team turfs after resetting it to 0 (which make no sense)
}
}
return turf; //return 0 which is variable 'turf' as u havent change the value of it
}
I removed the part where the turfs were getting set to 0 over and over, and now the loop isn't stopping and is running over and over and the number of turfs owned by a team is getting increased by a fuckton of times.