Proooooblem pls help!
#1

IT IS A CUT OF MY GM!!

PHP код:
//at the beginnig...
#include <a_samp>
#include <float>
#include <Dini>
#include <Dutils>
#include <Seifader>
enum pTeams
{
    
TEAM_POLICE,
    
TEAM_SWAT,
    
TEAM_ARMY,
    
TEAM_AMCSI,
    
TEAM_COLUMBIANO,
    
TEAM_KINA,
    
TEAM_TERRO,
};
new 
teamScore[pTeams];
public 
OnPlayerDeath(playeridkilleridreason)
{
for(new 
i=0m=GetMaxPlayers(); i<mi++)
{
if(
gTeam[playerid] == TEAM_POLICE)
{
    
teamScore[TEAM_POLICE]++;//error 001: expected token: ";", but found "[" and error 001: expected token: ";", but found "]"
    
if(teamScore[TEAM_POLICE] >= 50)
    {
        
GameTextForAll("~w~Corleones Won",5000,0);
        
SetTimer("EndGM"10000,0);
    }
}
if(
gTeam[playerid] == TEAM_SWAT)
{
        
teamScore[i][TEAM_SWAT]++;
        if(
teamScore[i][TEAM_SWAT] >= 50)
        {
            
GameTextForAll("~w~Corleones Won",5000,0);
            
SetTimer("EndGM"10000,0);
        }
}
if(
gTeam[playerid] == TEAM_ARMY)
{
        
teamScore[i][TEAM_ARMY]++;
        if(
teamScore[i][TEAM_ARMY] >= 50)
        {
            
GameTextForAll("~w~Corleones Won",5000,0);
            
SetTimer("EndGM"10000,0);
        }
}
if(
gTeam[playerid] == TEAM_AMCSI)
{
        
teamScore[i][TEAM_AMCSI]++;
        if(
teamScore[i][TEAM_AMCSI] >= 50)
        {
            
GameTextForAll("~w~Corleones Won",5000,0);
            
SetTimer("EndGM"10000,0);
        }
}
if(
gTeam[playerid] == TEAM_COLUMBIANO)
{
        
teamScore[i][TEAM_COLUMBIANO]++;
        if(
teamScore[i][TEAM_COLUMBIANO] >= 50)
        {
            
GameTextForAll("~w~Corleones Won",5000,0);
            
SetTimer("EndGM"10000,0);
        }
}
if(
gTeam[playerid] == TEAM_KINA)
{
        
teamScore[i][TEAM_KINA]++;
        if(
teamScore[i][TEAM_KINA] >= 50)
        {
            
GameTextForAll("~w~Corleones Won",5000,0);
            
SetTimer("EndGM"10000,0);
        }
}
if(
gTeam[playerid] == TEAM_TERRO)
{
        
teamScore[i][TEAM_TERRO]++;
        if(
teamScore[i][TEAM_TERRO] >= 50)
        {
            
GameTextForAll("~w~Corleones Won",5000,0);
            
SetTimer("EndGM"10000,0);
        }
}
}
    return 
1;

Reply
#2

can enyone help me?
Reply
#3

d:\LETONAK2\gamemodes\Gang-Wars.pwn(540) : warning 216: nested comment
d:\LETONAK2\gamemodes\Gang-Wars.pwn(891) : warning 213: tag mismatch
d:\LETONAK2\gamemodes\Gang-Wars.pwn(892) : warning 213: tag mismatch
d:\LETONAK2\gamemodes\Gang-Wars.pwn(900) : warning 213: tag mismatch
d:\LETONAK2\gamemodes\Gang-Wars.pwn(900) : warning 215: expression has no effect
d:\LETONAK2\gamemodes\Gang-Wars.pwn(900) : error 001: expected token: ";", but found "["
d:\LETONAK2\gamemodes\Gang-Wars.pwn(900) : error 029: invalid expression, assumed zero
d:\LETONAK2\gamemodes\Gang-Wars.pwn(900) : warning 215: expression has no effect
d:\LETONAK2\gamemodes\Gang-Wars.pwn(900) : error 001: expected token: ";", but found "]"
d:\LETONAK2\gamemodes\Gang-Wars.pwn(900) : fatal error 107: too many error messages on one line
Reply
#4

Please post line 900





Edit: Sorry.. Didn't see that in you scripting code.
Reply
#5

this is it

PHP код:
if(gTeam[playerid] == TEAM_SWAT)//line 898
{
        
teamScore[i][TEAM_SWAT]++;//line 900
        
if(teamScore[i][TEAM_SWAT] >= 50)//line 901
        
{
            
GameTextForAll("~w~Corleones Won",5000,0);//line 903
            
SetTimer("EndGM"10000,0);
        }

Reply
#6

PHP код:
teamScore[TEAM_POLICE]++; // Here you forgot that "[i]"
teamScore[i][TEAM_POLICE]++; // So it should look like.. Maybe this is the problem 

But maybe the "[i]" is the problem. Try it with "[i]" and then completly without that "[i]".
Reply
#7

thx, but it made an other problem...

i
PHP код:
f(gTeam[playerid] == TEAM_TERRO)
{
        
teamScore[TEAM_TERRO]++;//error 032: array index out of bounds (variable "teamScore")
        
if(teamScore[TEAM_TERRO] >= 50)//error 032: array index out of bounds (variable "teamScore")
        
{
            
GameTextForAll("~w~Corleones Won",5000,0);
            
SetTimer("EndGM"10000,0);
        }
}

Reply
#8

Ohhh that little but evil error

Just easy like that:

PHP код:
//Your script: 
enum pTeams
{
    
TEAM_POLICE,
    
TEAM_SWAT,
    
TEAM_ARMY,
    
TEAM_AMCSI,
    
TEAM_COLUMBIANO,
    
TEAM_KINA,
    
TEAM_TERRO// The little error.. Don't use "," for the last Team.
};
//Should be this:
enum pTeams
{
    
TEAM_POLICE,
    
TEAM_SWAT,
    
TEAM_ARMY,
    
TEAM_AMCSI,
    
TEAM_COLUMBIANO,
    
TEAM_KINA,
    
TEAM_TERRO // Tada :D
}; 

I think that is the error. Maybe I guess wrong.
Reply
#9

haha no -,-" xDDDD

PHP код:
"any ideas?"
//let's write :D 
Reply
#10

Hey, just try it. Sometimes are these little faults the reason for many errors
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)