[3errors] array sizes do not match...
#1

i've been trying to run Raven's script (RP) and it was fully with errors about 43 errors in total , i fixed many of them but still for me 3 im very tierd now ineed your help guys

PHP код:
C:\Users\ZOFTer\Desktop\0.3Z server\gamemodes\larp.pwn(25115) : error 021symbol already defined"strtok"
C:\Users\ZOFTer\Desktop\0.3Z server\gamemodes\larp.pwn(25130) : error 047: array sizes do not match, or destination array is too small
C
:\Users\ZOFTer\Desktop\0.3Z server\gamemodes\larp.pwn(68237) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase
3 Errors

PHP код:

strtok
(const string[], &index)
//======================25115=======================
    
new length strlen(string);
    while ((
index length) && (string[index] <= ' '))
    {
        
index++;
    }
    new 
offset index;
    new 
result[20];
    while ((
index length) && (string[index] > ' ') && ((index offset) < (sizeof(result) - 1)))
    {
        
result[index offset] = string[index];
        
index++;
    }
    
result[index offset] = EOS;
    return 
result;

PHP код:
trtok(const string[], &index)
{
    new 
length strlen(string);
    while ((
index length) && (string[index] <= ' '))
    {
        
index++;
    }
    new 
offset index;
    new 
result[20];
    while ((
index length) && (string[index] > ' ') && ((index offset) < (sizeof(result) - 1)))
    {
        
result[index offset] = string[index];
        
index++;
    }
    
result[index offset] = EOS;
    return 
result// ============================25130========================


PHP код:
            giveplayerid ReturnUser(tmp);
            if (
IsPlayerConnected(giveplayerid))
            {
                if(
giveplayerid != INVALID_PLAYER_ID)
                {
                    
x_weapon strtok(cmdtextidx); //=========================68237=====================
                    
if(!strlen(x_weapon))
                    {
                        if(
PlayerInfo[playerid][pRegularRank] == 0)
                        {
                            
SendClientMessage(playeridCOLOR_GRAD1"USAGE: /creategun [playerid/PartOfName] [weaponname]");
                            
SendClientMessage(playeridCOLOR_GREY"Weapons: knife(50) bat(25) flowers(25) silenced(100) deagle (225) Molotovs (800)");
                            
SendClientMessage(playeridCOLOR_GREY"Weapons: mp5(350) combat (600) shotgun(200) ak47(500) m4(650) country (450)");
                            
SendClientMessage(playeridCOLOR_GREY"Weapons: TEC9(200) MAC10 (275) Sniper(800) Colt45(125) sawnoff(300) RPG (1000)");
                            return 
1;
                        }
                        else
                        {
                               
SendClientMessage(playeridCOLOR_GRAD1"USAGE: /creategun [playerid/PartOfName] [weaponname]");
                            
SendClientMessage(playeridCOLOR_GREY"Weapons: knife(50) bat(25) flowers(25) silenced(100) deagle (225) Molotovs (800)");
                            
SendClientMessage(playeridCOLOR_GREY"Weapons: mp5(350) combat (600) shotgun(200) ak47(500) m4(650) country (450)");
                            
SendClientMessage(playeridCOLOR_GREY"Weapons: TEC9(200) MAC10 (275) Sniper(800) Colt45(125) sawnoff(300) RPG (1000)");
                            return 
1;
                        }
                    }
                } 
Reply
#2

BUMP ! , fixed Two errors , still one now

PHP код:
Line 68218 
PHP код:

            giveplayerid 
ReturnUser(tmp); 
            if (
IsPlayerConnected(giveplayerid)) 
            { 
                if(
giveplayerid != INVALID_PLAYER_ID
                { 
                    
x_weapon strtok(cmdtextidx); //=========================68218===================== 
                    
if(!strlen(x_weapon)) 
                    { 
                        if(
PlayerInfo[playerid][pRegularRank] == 0
                        { 
                            
SendClientMessage(playeridCOLOR_GRAD1"USAGE: /creategun [playerid/PartOfName] [weaponname]"); 
                            
SendClientMessage(playeridCOLOR_GREY"Weapons: knife(50) bat(25) flowers(25) silenced(100) deagle (225) Molotovs (800)"); 
                            
SendClientMessage(playeridCOLOR_GREY"Weapons: mp5(350) combat (600) shotgun(200) ak47(500) m4(650) country (450)"); 
                            
SendClientMessage(playeridCOLOR_GREY"Weapons: TEC9(200) MAC10 (275) Sniper(800) Colt45(125) sawnoff(300) RPG (1000)"); 
                            return 
1
                        } 
                        else 
                        { 
                               
SendClientMessage(playeridCOLOR_GRAD1"USAGE: /creategun [playerid/PartOfName] [weaponname]"); 
                            
SendClientMessage(playeridCOLOR_GREY"Weapons: knife(50) bat(25) flowers(25) silenced(100) deagle (225) Molotovs (800)"); 
                            
SendClientMessage(playeridCOLOR_GREY"Weapons: mp5(350) combat (600) shotgun(200) ak47(500) m4(650) country (450)"); 
                            
SendClientMessage(playeridCOLOR_GREY"Weapons: TEC9(200) MAC10 (275) Sniper(800) Colt45(125) sawnoff(300) RPG (1000)"); 
                            return 
1
                        } 
                    } 
                } 
Reply
#3

BUMP ! Fixed evry error in this Script , Thank you guys


the error was in
PHP код:
x_weapon[128
and i changed it to
PHP код:
x_weapon[256
for line 25115 , since the strtock already defined just delete it

thats all thanks
Reply
#4

Compiler errors are the easiest to solve, it tells you what line to go to, and even gives you a cryptic description of what exactly is wrong! Its the code that compiles perfectly, and doesn't work anyway that really take thinking to solve
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)