SA-MP Forums Archive
Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help (/showthread.php?tid=249784)



Help - Crystyan12 - 20.04.2011

Please help me for fix errors.


Код:
D:\SaMp\eGammerv4\gamemodes\eGamer.pwn(17370) : error 047: array sizes do not match, or destination array is too small
D:\SaMp\eGammerv4\gamemodes\eGamer.pwn(17890) : error 047: array sizes do not match, or destination array is too small
D:\SaMp\eGammerv4\gamemodes\eGamer.pwn(20681) : warning 219: local variable "mod" shadows a variable at a preceding level
D:\SaMp\eGammerv4\gamemodes\eGamer.pwn(49039) : error 021: symbol already defined: "strtok"
D:\SaMp\eGammerv4\gamemodes\eGamer.pwn(49054) : error 047: array sizes do not match, or destination array is too small
PHP код:
                    new x_nr[24];
                    
x_nr strtok(cmdtextidx); // 17370
                    
if(!strlen(x_nr))
                    {
                        
SendClientMessage(playeridCOLOR_WHITE"USAGE: /givenote [playerid/PartOfName] [note id]");
                        return 
1;
                    } 
PHP код:
new x_nr[64];
            
x_nr strtok(cmdtextidx); // 17890
            
if(!strlen(x_nr))
            {
                
SendClientMessage(playeridCRISTIAN,"_______________________________________"); 
PHP код:
new ammocharge;
            new 
mod 100// 20681
            
new location PlayerInfo[playerid][pLocal];
            if(
location == 99 || location == 100 || location == 102
PHP код:
strtok(const string[], &index)  // 49039
{
    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// 49054




Re: Help - Sasino97 - 20.04.2011

1 - x_nr must be the same size of idx
2 - same concept as step 1
3 - 'mod' already exists. Don't use 'new', or just change 'mod' to 'mod2' or 'MOD' or 'Mod'
4 - 'strtok' already exists. Delete it


Re: Help - Stigg - 20.04.2011

pawn Код:
new x_nr[24];
Up the value of that to:
pawn Код:
new x_nr[128];
And delete this:
pawn Код:
strtok(const string[], &index)  // 49039
{
    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; // 49054
}
As it is already defined.

And lastly change:
pawn Код:
new mod = 100; // 20681
To:
pawn Код:
new mod_2 = 100; // 20681



Re: Help - Sascha - 20.04.2011

pawn Код:
new x_nr[256];
                    x_nr = strtok(cmdtext, idx); // 17370
                    if(!strlen(x_nr))
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givenote [playerid/PartOfName] [note id]");
                        return 1;
                    }
pawn Код:
new x_nr[256];
            x_nr = strtok(cmdtext, idx); // 17890
            if(!strlen(x_nr))
            {
                SendClientMessage(playerid, CRISTIAN,"_______________________________________");
pawn Код:
new ammocharge;
            mod = 100; // 20681
            new location = PlayerInfo[playerid][pLocal];
            if(location == 99 || location == 100 || location == 102)
pawn Код:
stock strtok(const string[], &index)  // 49039
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[256];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result; // 49054
}
try this


edit: slow lol


Re: Help - Crystyan12 - 20.04.2011

Solved:X

THX all!