Code not working.
#7

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 0MAX_TURFSi++) //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 ] = // 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 0MAX_TURFSi++) //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.
Reply


Messages In This Thread
Code not working. - by Ritzy2K - 18.11.2017, 04:16
Re: Code not working. - by Sithis - 18.11.2017, 06:25
Re: Code not working. - by Ritzy2K - 18.11.2017, 06:40
Re: Code not working. - by Juvanii - 18.11.2017, 08:54
Re: Code not working. - by Ritzy2K - 18.11.2017, 08:59
Re: Code not working. - by Juvanii - 18.11.2017, 09:23
Re: Code not working. - by Ritzy2K - 18.11.2017, 10:03
Re: Code not working. - by Ritzy2K - 18.11.2017, 10:15
Re: Code not working. - by Juvanii - 18.11.2017, 10:36
Re: Code not working. - by Ritzy2K - 18.11.2017, 10:46

Forum Jump:


Users browsing this thread: 1 Guest(s)