String lenght, or something else?
#1

Hi,

So the main error I'm getting to server.exe::
PHP код:
[debugRun time error 4"Array index out of bounds"
[debug]  Attempted to read/write array element at negative index -1
[debugAMX backtrace:
[
debug#0 0018f150 in ?? (-1) from GLS.amx
[debug#1 0018fdcc in ?? (0) from GLS.amx
[debug#2 00214cd8 in ?? (0, 839, 1, 2, 36028264) from GLS.amx
[debug#3 0000955c in public OnDialogResponse (0, 839, 1, 2, 36028264) from GLS.amx 
The thing is that, dialogs listitems options/option opens only for one time, doesn't metter which one, but next time it doesn't opens anymore.

Dialog:
PHP код:
if(dialogid == 839){
        if(
response){
            new 
idjo[1000];
            if(
player[playerid][pWorkLeader] >= && frakcija[player[playerid][pWorkLeader]][fReq] == 1){ 
                
id player[playerid][pWorkLeader]; }
            else if(
player[playerid][pWorkSubLeader] >= && frakcija[player[playerid][pWorkLeader]][fReq] == 1){
                
id player[playerid][pWorkSubLeader]; }
            switch(
listitem){
                case 
0fAction[playerid] = 1;
                case 
1fAction[playerid] = 3;
                case 
2fAction[playerid] = 4;
                case 
3fAction[playerid] = 5;
            }
            
format(zinute70"Redaguojama „%s“ frakcija"frakcija[id][fName]);
            
format(g_szBuffer300" {ffffff}Redaguojama „{d8a9ff}%s{ffffff}“ frakcija:\n \n    {d8a9ff}•{ffffff} atliekamas veiksmas %s,"frakcija[id][fName], getActionEdit(playerid));
            
strcat(jog_szBuffer);
            
format(g_szBuffer700"\n {d8a9ff}•{ffffff} veiksmo informacija %s"setActionInfo(playerid));
            
strcat(jog_szBuffer);
            
ShowPlayerDialog(playerid852DIALOG_STYLE_INPUTzinutejo"Keisti""Atgal");
        } else 
leaderDialog(playerid);
    } 
Functions:
PHP код:
setActionInfo(playerid)
{
    new 
ActionInfo[341],
        
id fChosen[playerid];
    switch(
fAction[playerid])
    {
        case 
0ActionInfo "-";
        case 
1:
        {
            
format(ActionInfo100"dabartinis patirties reikalavimas {d8a9ff}%s{ffffff}, įvęskite naująjį į laukelį !",FormatNumber(frakcija[id][fScore]));
        }
        case 
2:
        {
            
format(ActionInfo120"dabartinis darbo vietų skaičius {d8a9ff}%s{ffffff} ( darbuotojų {d8a9ff}%s{ffffff} ) įvęskite naująjį į laukelį !",FormatNumber(frakcija[id][fSlots]), FormatNumber(frakcija[id][fSlotUsed]));
        }
        case 
3:
        {
            
format(ActionInfo260"dabartiniai reikalaujami dokumentai {d8a9ff}%s{ffffff},\n \n{d8a9ff}0{ffffff}. dokumentai nereikalaujami,\n{d8a9ff}1{ffffff}. sveikatos paћymai\n{d8a9ff}2{ffffff}. ginklų lic.\n{d8a9ff}3{ffffff}. sveikatos paћyma, ginklų lic.\n \nįvęskite skaičių į laukelį !",getDocsInfo(id));
        }
        case 
4:
        {
            
format(ActionInfo340"dabartinės reikalaujamos teisės {d8a9ff}%s{ffffff},\n \n{d8a9ff}0{ffffff}. teisės nereikalaujamos,\n{d8a9ff}1{ffffff}. A kat.\n{d8a9ff}2{ffffff}. B kat.\n{d8a9ff}3{ffffff}. C kat.\n{d8a9ff}4{ffffff}. A, B kat.\n{d8a9ff}5{ffffff}. A, C kat.\n{d8a9ff}6{ffffff}. B, C kat.\n{d8a9ff}7{ffffff}. A ,B, C kat.\n \nįvęskite skaičių į laukelį !",getLicensesInfo(id));
          }
        case 
5:
        {
            
format(ActionInfo130"dabartinis darbo kontrakto laikas {d8a9ff}%s{ffffff}, įvęskite naująjį į laukelį ( {d8a9ff}1 = 1val.{ffffff} ) !",ConvertSeconds(frakcija[id][fConTime]));
        }
        case 
6:
        {
            
format(ActionInfo90"įvęskite naujojo frakcijos lyderio {d8a9ff}Vardą_Pavardę{ffffff} !",ConvertSeconds(frakcija[id][fConTime]));
        }
        case 
7:
        {
            
format(ActionInfo115"dabartinis frakcijos lyderis {d8a9ff}%s{ffffff}, spauskite iљmesti, norėdami jį iљmesti!",frakcija[id][fLeader]);
        }
        case 
8:
        {
            
format(ActionInfo60"spauskite įspėti, norėdami įspėti frakcijos lyderį !",ConvertSeconds(frakcija[id][fConTime]));
        }
        case 
9:
        {
            
format(ActionInfo65"spauskite nuimti, norėdami paљalinti frakcijos lyderio įspėjimą !",ConvertSeconds(frakcija[id][fConTime]));
        }
        case 
10:
        {
            
format(ActionInfo70"įvęskite naujojo frakcijos sub-lyderio {d8a9ff}Vardą_Pavardę{ffffff} !",ConvertSeconds(frakcija[id][fConTime]));
        }
        case 
11:
        {
            
format(ActionInfo115"dabartinis frakcijos sub-lyderis {d8a9ff}%s{ffffff}, spauskite iљmesti, norėdami jį iљmesti!",frakcija[id][fSubLeader]);
        }
        case 
12:
        {
            
format(ActionInfo60"spauskite įspėti, norėdami įspėti frakcijos sub-lyderį !",ConvertSeconds(frakcija[id][fConTime]));
        }
        case 
13:
        {
            
format(ActionInfo70"spauskite nuimti, norėdami paљalinti frakcijos lyderio įspėjimą !",ConvertSeconds(frakcija[id][fConTime]));
        }
        case 
14:
        {
            
format(ActionInfo70"įvęskite frakcijos sub-lyderio {d8a9ff}Vardą_Pavardę{ffffff} !",ConvertSeconds(frakcija[id][fConTime]));
        }
        case 
15:
        {
            
format(ActionInfo62"įvęskite frakcijos sub-lyderio {d8a9ff}Vardą_Pavardę{ffffff} !",ConvertSeconds(frakcija[id][fConTime]));
        }
    }
    return 
ActionInfo;

PHP код:
getActionEdit(playerid)
{
    new 
ActionEdit[60];
    switch(
fAction[playerid])
    {
        case 
0ActionEdit "-";
        case 
1ActionEdit "patirties reikalavimo keitimas";
        case 
2ActionEdit "darbo vietų skaičiaus keitimas";
        case 
3ActionEdit "reikalaujamų dokumentų keitimas";
        case 
4ActionEdit "reikalaujamų teisių keitimas";
        case 
5ActionEdit "darbo kontrakto laiko keitimas";
        case 
6ActionEdit "naujo, prisijungusio lyderio paskyrimas";
        case 
7ActionEdit "lyderio iљmetimas";
        case 
8ActionEdit "lyderio įspėjimas";
        case 
9ActionEdit "lyderio įspėjimo paљalinimas";
        case 
10ActionEdit "naujo, prisijūngusio sub-lyderio paskyrimas";
        case 
11ActionEdit "sub-lyderio iљmetimas";
        case 
12ActionEdit "sub-lyderio įspėjimas";
        case 
13ActionEdit "sub-lyderio įspėjimo paљalinimas";
        case 
14ActionEdit "naujo, atsijungusio lyderio paskyrimas";
        case 
15ActionEdit "naujo, atsijungusio sub-lyderio paskyrimas";
    }
    return 
ActionEdit;

Reply
#2

It's hard to tell where exactly the error appears without knowing the values for some of the Arrays you use. Could you compile your mode with debug symbols and reproduce it so that crashdetect shows the exact line where the error(s) appeared?
You can do that by creating "pawn.cfg" inside your pawno folder and write "-r -d3" into it, then recompile.
Reply
#3

Quote:
Originally Posted by NaS
Посмотреть сообщение
It's hard to tell where exactly the error appears without knowing the values for some of the Arrays you use. Could you compile your mode with debug symbols and reproduce it so that crashdetect shows the exact line where the error(s) appeared?
You can do that by creating "pawn.cfg" inside your pawno folder and write "-r -d3" into it, then recompile.
It shows witch dialog causing the error, i fixed that. But the second thing, that
PHP код:
format(g_szBuffer700"\n {d8a9ff}•{ffffff} veiksmo informacija %s"setActionInfo(playerid)); strcat(jog_szBuffer); 
this line doesn't fit all the text, doesn't metter how long I will make. Probably its too long to put in dialog, how can I put it all together, when im using strcat and stock?

PHP код:
    if(dialogid == 839){
        if(
response){
            new 
idjo[700];
            if(
player[playerid][pWorkLeader] >= && frakcija[player[playerid][pWorkLeader]][fReq] == 1){ 
                
id player[playerid][pWorkLeader]; }
            else if(
player[playerid][pWorkSubLeader] >= && frakcija[player[playerid][pWorkLeader]][fReq] == 1){
                
id player[playerid][pWorkSubLeader]; }
            switch(
listitem){
                case 
0fAction[playerid] = 1;
                case 
1fAction[playerid] = 3;
                case 
2fAction[playerid] = 4;
                case 
3fAction[playerid] = 5;
            }
            
fChosen[playerid] = -1;
            
printf("%d id, %d Action"idfAction[playerid]);
            
format(zinute70"Redaguojama „%s“ frakcija"frakcija[id][fName]);
            
format(g_szBuffer300" {ffffff}Redaguojama „{d8a9ff}%s{ffffff}“ frakcija:\n \n    {d8a9ff}•{ffffff} atliekamas veiksmas %s,\n {d8a9ff}•{ffffff} veiksmo informacija"frakcija[id][fName], getActionEdit(playerid));
            
strcat(jog_szBuffer);
            
format(g_szBuffer400"%s"setActionInfo(playerid));
            
strcat(jog_szBuffer);
            
ShowPlayerDialog(playerid852DIALOG_STYLE_INPUTzinutejo"Keisti""Atgal");
        } else 
leaderDialog(playerid);
    }
[
B]3 id1 Action[/B]
[
debugRun time error 4"Array index out of bounds"
[debug]  Attempted to read/write array element at negative index -1
[debugAMX backtrace:
[
debug#0 0018fb30 in ?? (0) from GLS.amx
[debug#1 00215440 in ?? (0, 839, 1, 0, 36028472) from GLS.amx
[debug#2 0000955c in public OnDialogResponse (0, 839, 1, 0, 36028472) from GLS.amx 
Still buggy, I'm so confused.

PHP код:
if(dialogid == 852)
    {
        new 
kiek strval(inputtext),
            
id;
        if(
player[playerid][pWorkLeader] >= 0){ 
            
id player[playerid][pWorkLeader];
        } else if(
fChosen[playerid] >= 0){
            
id fChosen[playerid];
        }
        
printf("%d id, %d Action"idfAction[playerid]);
        if(
response)
        {
            
printf("%d id, %d Action"idfAction[playerid]);
            switch(
fAction[playerid])
            {
                case 
1:
                {                        
                    if(!
IsNumeric(inputtext)) return SendError(playerid"laukelyje galima įvęsti tik skaičių !"), fAction[playerid] = -1;
                    
                    if(
kiek 0) return SendError(playerid"minusinio skaičiaus būti negali!"), fAction[playerid] = -1;
                    if(
kiek 15000) return SendError(playerid"skaičius negali būti > 15 000 !"), fAction[playerid] = -1;
                    
                    
format(g_szBuffer148"{d8a9ff}•{ffffff} pakeitėt „{d8a9ff}%s{ffffff}“ frakcijos patirties reikalavimą iљ {d8a9ff}%s{ffffff} į {d8a9ff}%s{ffffff} !"frakcija[id][fName], FormatNumber(frakcija[id][fScore]), FormatNumber(kiek));
                    
SendClientMessage(playerid, -1g_szBuffer);
                    
                    
frakcija[id][fScore] = kiek;
                    
updateFractionLabel(id);
                    
                    
fAction[playerid] = -1;
                    
fChosen[playerid] = -1;
                }
                case 
2:
                {
                    if(!
IsNumeric(inputtext)) return SendError(playerid"laukelyje galima įvęsti tik skaičių !"), fAction[playerid] = -1;
                    
                    if(
kiek 0) return SendError(playerid"minusinio skaičiaus laukelyje būti negali!"), fAction[playerid] = -1;
                    if(
kiek 500) return SendError(playerid"skaičius negali būti > 500 !"), fAction[playerid] = -1;
                    
                    
format(g_szBuffer148"{d8a9ff}•{ffffff} pakeitėt „{d8a9ff}%s{ffffff}“ frakcijos darbuotojų skaičių iљ {d8a9ff}%s{ffffff} į {d8a9ff}%s{ffffff} !"frakcija[id][fName], FormatNumber(frakcija[id][fSlots]), FormatNumber(kiek));
                    
SendClientMessage(playerid, -1g_szBuffer);
                    
                    
frakcija[id][fSlots] = kiek;
                    
updateFractionLabel(id);
                    
fAction[playerid] = -1;
                    
fChosen[playerid] = -1;
                }
                case 
3:
                {
                    if(!
IsNumeric(inputtext)) return SendError(playerid"laukelyje galima įvęsti tik skaičių !"), fAction[playerid] = -1;
                    
                    if(
kiek 0) return SendError(playerid"minusinio skaičiaus laukelyje būti negali!"), fAction[playerid] = -1;
                    if(
kiek 3) return SendError(playerid"skaičius negali būti > 3 !"), fAction[playerid] = -1;
                    
                    
format(g_szBuffer148"{d8a9ff}•{ffffff} pakeitėt „{d8a9ff}%s{ffffff}“ frakcijos dok. reik. iљ %s į %s !"frakcija[id][fName], getDocsInfo(id), getUpdatedDocsInfo(kiek));
                    
SendClientMessage(playerid, -1g_szBuffer);
                    
                    
frakcija[id][fDocs] = kiek;
                    
updateFractionLabel(id);
                    
fAction[playerid] = -1;
                    
fChosen[playerid] = -1;
                }
                case 
4:
                {        
                    if(!
IsNumeric(inputtext)) return SendError(playerid"laukelyje galima įvęsti tik skaičių !"), fAction[playerid] = -1;
                    if(
kiek 0) return SendError(playerid"minusinio skaičiaus laukelyje būti negali!"), fAction[playerid] = -1;
                    if(
kiek 3) return SendError(playerid"skaičius negali būti > 3 !"), fAction[playerid] = -1;
                    
                    
format(g_szBuffer148"{d8a9ff}•{ffffff} pakeitėt „{d8a9ff}%s{ffffff}“ frakcijos teisių reik. iљ %s į %s"frakcija[id][fName], getLicensesInfo(id), getUpdatedLicensesInfo(kiek));
                    
SendClientMessage(playerid, -1g_szBuffer);
                    
frakcija[id][fLicenses] = kiek;
                    
updateFractionLabel(id);
                    
fAction[playerid] = -1;
                    
fChosen[playerid] = -1;
                }
                case 
5:
                {
                    if(!
IsNumeric(inputtext)) return SendError(playerid"laukelyje galima įvęsti tik skaičių !"), fAction[playerid] = -1;
                    if(
kiek 0) return SendError(playerid"minusinio skaičiaus laukelyje būti negali!"), fAction[playerid] = -1;
                    if(
kiek 168) return SendError(playerid"skaičius negali būti > 168 !"), fAction[playerid] = -1;
                    
                    
format(g_szBuffer148"{d8a9ff}•{ffffff} pakeitėt „{d8a9ff}%s{ffffff}“ frakcijos kontrakto laiką iљ %s į %s !"frakcija[id][fName], ConvertSeconds(frakcija[id][fConTime]), ConvertSeconds(kiek*6000));
                    
SendClientMessage(playerid, -1g_szBuffer);
                    
                    
frakcija[id][fConTime] = kiek*3600;
                    
updateFractionLabel(id);
                    
fAction[playerid] = -1;
                    
fChosen[playerid] = -1;
                }
                case 
6:
                {
                    new
                        
zd;
                    if(
sscanf(inputtext,"u"zd))
                    {
                        
SendError(playerid"laukelis neuћpildytas !");
                        
fAction[playerid] = 6;
                        
format(zinute90"Redaguojama „%s“ frakcija"frakcija[fChosen[playerid]][fName]);
                        
format(g_szBuffer148"{ffffff}Redaguojama „{d8a9ff}%s{ffffff}“ frakcija:\n \n    {d8a9ff}•{ffffff} atliekamas veiksmas %s,\n    {d8a9ff}•{ffffff} veiksmo informacija %s"frakcija[fChosen[playerid]][fName], getActionEdit(playerid), setActionInfo(playerid));
                        
ShowPlayerDialog(playerid855DIALOG_STYLE_MSGBOXzinuteg_szBuffer"Keisti""Atgal");
                        return 
1;
                    }
                    if( 
stopSymbolsinputtext ) )
                    {
                        
SendError(playerid"laukelis neuћpildytas !");
                        
fAction[playerid] = 6;
                        
format(zinute90"Redaguojama „%s“ frakcija"frakcija[fChosen[playerid]][fName]);
                        
format(g_szBuffer148"{ffffff}Redaguojama „{d8a9ff}%s{ffffff}“ frakcija:\n \n    {d8a9ff}•{ffffff} atliekamas veiksmas %s,\n    {d8a9ff}•{ffffff} veiksmo informacija %s"frakcija[fChosen[playerid]][fName], getActionEdit(playerid), setActionInfo(playerid));
                        
ShowPlayerDialog(playerid855DIALOG_STYLE_MSGBOXzinuteg_szBuffer"Keisti""Atgal");
                        return 
1;
                    }
                    if( 
zd == INVALID_PLAYER_ID )
                    {
                        
SendError(playerid"tokio ћaidėjo serveryje nėra !");
                        
fAction[playerid] = 6;
                        
format(zinute90"Redaguojama „%s“ frakcija"frakcija[fChosen[playerid]][fName]);
                        
format(g_szBuffer148"{ffffff}Redaguojama „{d8a9ff}%s{ffffff}“ frakcija:\n \n    {d8a9ff}•{ffffff} atliekamas veiksmas %s,\n    {d8a9ff}•{ffffff} veiksmo informacija %s"frakcija[fChosen[playerid]][fName], getActionEdit(playerid), setActionInfo(playerid));
                        
ShowPlayerDialog(playerid855DIALOG_STYLE_MSGBOXzinuteg_szBuffer"Keisti""Atgal");
                        return 
1;
                    }
                    if(
player[zd][pWorkLeader] > 0)
                    {
                        
SendError(playerid"ћaidėjas jau atstovauja frakcijai !");
                        
fAction[playerid] = 6;
                        
format(zinute90"Redaguojama „%s“ frakcija"frakcija[fChosen[playerid]][fName]);
                        
format(g_szBuffer148"{ffffff}Redaguojama „{d8a9ff}%s{ffffff}“ frakcija:\n \n    {d8a9ff}•{ffffff} atliekamas veiksmas %s,\n    {d8a9ff}•{ffffff} veiksmo informacija %s"frakcija[fChosen[playerid]][fName], getActionEdit(playerid), setActionInfo(playerid));
                        
ShowPlayerDialog(playerid855DIALOG_STYLE_MSGBOXzinuteg_szBuffer"Keisti""Atgal");
                        return 
1;
                    }
                    
player[zd][pWorkLeader] = fChosen[playerid];
                    
format(g_szBuffer148"{d8a9ff}•{ffffff} lyderių vadovas {d8a9ff}%s{ffffff} paskyrė jus frakcijos „{d8a9ff}%s{ffffff}“ lyderiu !"getPlayerName(playerid), frakcija[fChosen[playerid]][fName]);
                    
SendClientMessage(zd,-1g_szBuffer);
                    
format(frakcija[fChosen[playerid]][fLeader], MAX_PLAYER_NAME+1"%s"getPlayerName(zd));
                    
format(g_szBuffer148"{d8a9ff}•{ffffff} lyderių vadovas {d8a9ff}%s{ffffff} paskyrė naująjį „{d8a9ff}%s{ffffff}“ frakcijos lyderį {d8a9ff}%s{ffffff} !"getPlayerName(playerid), frakcija[fChosen[playerid]][fName], getPlayerName(zd));
                    
SendClientMessageToAll(-1g_szBuffer);
                    
updateFractionLabel(fChosen[playerid]);
                    
fAction[playerid] = -1;
                    
fChosen[playerid] = -1;
                }
                case 
10:
                {
                    new
                        
zd;
                    if(
sscanf(inputtext,"u"zd))
                    {
                        
SendError(playerid"laukelis neuћpildytas !");
                        
fAction[playerid] = 6;
                        
format(zinute90"Redaguojama „%s“ frakcija"frakcija[fChosen[playerid]][fName]);
                        
format(g_szBuffer170"{ffffff}Redaguojama „{d8a9ff}%s{ffffff}“ frakcija:\n \n    {d8a9ff}•{ffffff} atliekamas veiksmas %s,\n    {d8a9ff}•{ffffff} veiksmo informacija %s"frakcija[fChosen[playerid]][fName], getActionEdit(playerid), setActionInfo(playerid));
                        
ShowPlayerDialog(playerid855DIALOG_STYLE_MSGBOXzinuteg_szBuffer"Keisti""Atgal");
                        return 
1;
                    }
                    if( 
stopSymbolsinputtext ) )
                    {
                        
SendError(playerid"laukelis neuћpildytas !");
                        
fAction[playerid] = 6;
                        
format(zinute90"Redaguojama „%s“ frakcija"frakcija[fChosen[playerid]][fName]);
                        
format(g_szBuffer170"{ffffff}Redaguojama „{d8a9ff}%s{ffffff}“ frakcija:\n \n    {d8a9ff}•{ffffff} atliekamas veiksmas %s,\n    {d8a9ff}•{ffffff} veiksmo informacija %s"frakcija[fChosen[playerid]][fName], getActionEdit(playerid), setActionInfo(playerid));
                        
ShowPlayerDialog(playerid855DIALOG_STYLE_MSGBOXzinuteg_szBuffer"Keisti""Atgal");
                        return 
1;
                    }
                    if( 
zd == INVALID_PLAYER_ID )
                    {
                        
SendError(playerid"tokio ћaidėjo serveryje nėra !");
                        
fAction[playerid] = 6;
                        
format(zinute90"Redaguojama „%s“ frakcija"frakcija[fChosen[playerid]][fName]);
                        
format(g_szBuffer170"{ffffff}Redaguojama „{d8a9ff}%s{ffffff}“ frakcija:\n \n    {d8a9ff}•{ffffff} atliekamas veiksmas %s,\n    {d8a9ff}•{ffffff} veiksmo informacija %s"frakcija[fChosen[playerid]][fName], getActionEdit(playerid), setActionInfo(playerid));
                        
ShowPlayerDialog(playerid855DIALOG_STYLE_MSGBOXzinuteg_szBuffer"Keisti""Atgal");
                        return 
1;
                    }
                    if(
player[zd][pWorkSubLeader] > 0)
                    {
                        
SendError(playerid"ћaidėjas jau atstovauja frakcijai !");
                        
fAction[playerid] = 6;
                        
format(zinute90"Redaguojama „%s“ frakcija"frakcija[fChosen[playerid]][fName]);
                        
format(g_szBuffer170"{ffffff}Redaguojama „{d8a9ff}%s{ffffff}“ frakcija:\n \n    {d8a9ff}•{ffffff} atliekamas veiksmas %s,\n    {d8a9ff}•{ffffff} veiksmo informacija %s"frakcija[fChosen[playerid]][fName], getActionEdit(playerid), setActionInfo(playerid));
                        
ShowPlayerDialog(playerid855DIALOG_STYLE_MSGBOXzinuteg_szBuffer"Keisti""Atgal");
                        return 
1;
                    }
                    
player[zd][pWorkSubLeader] = fChosen[playerid];
                    
format(g_szBuffer148"{d8a9ff}•{ffffff} lyderių vadovas {d8a9ff}%s{ffffff} paskyrė jus frakcijos „{d8a9ff}%s{ffffff}“ sub-lyderiu !"getPlayerName(playerid), frakcija[fChosen[playerid]][fName]);
                    
SendClientMessage(playerid,-1g_szBuffer);
                    
format(frakcija[fChosen[playerid]][fSubLeader], MAX_PLAYER_NAME+1"%s"getPlayerName(zd));
                    
format(g_szBuffer148"{d8a9ff}•{ffffff} lyderių vadovas {d8a9ff}%s{ffffff} paskyrė naująjį „{d8a9ff}%s{ffffff}“ frakcijos sub-lyderį {d8a9ff}%s{ffffff} !"getPlayerName(playerid), frakcija[fChosen[playerid]][fName], getName(zd));
                    
SendClientMessageToAll(-1g_szBuffer);
                    
updateFractionLabel(fChosen[playerid]);
                    
fAction[playerid] = -1;
                    
fChosen[playerid] = -1;
                }
                case 
14:
                {
                    new 
zname[24];
                    if(
sscanf(inputtext,"s[24]"zname))
                    {
                        
SendError(playerid"laukelis nebuvo pilnai uћpildytas !");
                        
fAction[playerid] = 14;
                        
format(zinute90"Redaguojama „%s“ frakcija"frakcija[fChosen[playerid]][fName]);
                        
format(g_szBuffer170"{ffffff}Redaguojama „{d8a9ff}%s{ffffff}“ frakcija:\n \n    {d8a9ff}•{ffffff} atliekamas veiksmas %s,\n    {d8a9ff}•{ffffff} veiksmo informacija %s"frakcija[fChosen[playerid]][fName], getActionEdit(playerid), setActionInfo(playerid));
                        
ShowPlayerDialog(playerid855DIALOG_STYLE_MSGBOXzinuteg_szBuffer"Keisti""Atgal");
                        return 
1;
                    }
                    if(!
strcmp(getPlayerName(playerid), znamefalse))
                    {
                        
SendError(playerid"savęs lyderiu nustatyti negalite !");
                        
fAction[playerid] = 14;
                        
format(zinute90"Redaguojama „%s“ frakcija"frakcija[fChosen[playerid]][fName]);
                        
format(g_szBuffer170"{ffffff}Redaguojama „{d8a9ff}%s{ffffff}“ frakcija:\n \n    {d8a9ff}•{ffffff} atliekamas veiksmas %s,\n    {d8a9ff}•{ffffff} veiksmo informacija %s"frakcija[fChosen[playerid]][fName], getActionEdit(playerid), setActionInfo(playerid));
                        
ShowPlayerDialog(playerid855DIALOG_STYLE_MSGBOXzinuteg_szBuffer"Keisti""Atgal");
                        return 
1;
                    }
                    
format(g_szBuffer300"SELECT `pName` FROM `"MySQL_PLAYERS_TABLE"` WHERE pName = '%s' LIMIT 1"zname);
                     new 
Cache:xData mysql_query(dbHandle,g_szBuffer);
                    new 
nameCheck[24];
                    
format(nameChecksizeof nameCheck"%s"cache_get_field_name0"pName" ));
                    if(
cache_get_row_count() == 1)
                    {
                        
format(g_szBuffer300"SELECT `Leader` FROM `"MySQL_PLAYERS_TABLE"` WHERE pName = '%s' LIMIT 1"zname);
                        new 
Cache:Data mysql_query(dbHandle,g_szBuffer);
                        new 
Leading cache_get_field_content_int0"Leader" );
                        if(
Leading 0)
                        {
                            
SendError(playerid"ћaidėjas jau vadovauja frakcijai !");
                            
fChosen[playerid] = -1;
                            
fAction[playerid] = -1;
                        }
                        else
                        {
                            
format(g_szBuffer150,
                            
"UPDATE `"MySQL_PLAYERS_TABLE"` SET \
                            \
                                `Leader` = '%i' \
                            \
                            WHERE pName = '%s'"
,
                               
fChosen[playerid],
                            
zname);
                            
mysql_query(dbHandle,g_szBuffer);
                            
format(frakcija[fChosen[playerid]][fLeader], MAX_PLAYER_NAME+1"%s"zname);
                            
format(zinute148"{d8a9ff}•{ffffff} paskirtas naujasis „{d8a9ff}%s{ffffff}“ frakcijos lyderis {d8a9ff}%s{ffffff} !"frakcija[fChosen[playerid]][fName], zname);
                            
SendClientMessageToAll(-1zinute);
                            
updateFractionLabel(fChosen[playerid]);
                            
fAction[playerid] = -1;
                            
fChosen[playerid] = -1;
                        }
                        
cache_deleteData );
                    }
                    else
                    {
                        
SendError(playerid"duomenų bazėje toks ћaidėjas neegzistuoja !");
                        
                        
fAction[playerid] = 14;
                        
format(zinute90"Redaguojama „%s“ frakcija"frakcija[fChosen[playerid]][fName]);
                        
format(g_szBuffer148"{ffffff}Redaguojama „{d8a9ff}%s{ffffff}“ frakcija:\n \n    {d8a9ff}•{ffffff} atliekamas veiksmas %s,\n    {d8a9ff}•{ffffff} veiksmo informacija %s"frakcija[fChosen[playerid]][fName], getActionEdit(playerid), setActionInfo(playerid));
                        
ShowPlayerDialog(playerid855DIALOG_STYLE_MSGBOXzinuteg_szBuffer"Keisti""Atgal");
                    }
                    
cache_deletexData );
                }
                case 
15:
                {
                    new 
zname[24];
                    if(
sscanf(inputtext,"s[24]"zname))
                    {
                        
SendError(playerid"laukelis nebuvo pilnai uћpildytas !");
                        
fAction[playerid] = 14;
                        
format(zinute90"Redaguojama „%s“ frakcija"frakcija[fChosen[playerid]][fName]);
                        
format(g_szBuffer170"{ffffff}Redaguojama „{d8a9ff}%s{ffffff}“ frakcija:\n \n    {d8a9ff}•{ffffff} atliekamas veiksmas %s,\n    {d8a9ff}•{ffffff} veiksmo informacija %s"frakcija[fChosen[playerid]][fName], getActionEdit(playerid), setActionInfo(playerid));
                        
ShowPlayerDialog(playerid855DIALOG_STYLE_LISTzinuteg_szBuffer"Keisti""Atgal");
                        return 
1;
                    }
                    if(!
strcmp(getPlayerName(playerid), znamefalse))
                    {
                        
SendError(playerid"savęs lyderiu nustatyti negalite !");
                        
fAction[playerid] = 14;
                        
format(zinute90"Redaguojama „%s“ frakcija"frakcija[fChosen[playerid]][fName]);
                        
format(g_szBuffer170"{ffffff}Redaguojama „{d8a9ff}%s{ffffff}“ frakcija:\n \n    {d8a9ff}•{ffffff} atliekamas veiksmas %s,\n    {d8a9ff}•{ffffff} veiksmo informacija %s"frakcija[fChosen[playerid]][fName], getActionEdit(playerid), setActionInfo(playerid));
                        
ShowPlayerDialog(playerid855DIALOG_STYLE_LISTzinuteg_szBuffer"Keisti""Atgal");
                        return 
1;
                    }
                    
format(g_szBuffer300"SELECT `pName` FROM `"MySQL_PLAYERS_TABLE"` WHERE pName = '%s' LIMIT 1"zname);
                    new 
Cache:xData mysql_query(dbHandle,g_szBuffer);
                    new 
nameCheck[24];
                    
format(nameChecksizeof nameCheck"%s"cache_get_field_name0"pName" ));
                    if(
cache_get_row_count() == 1)
                    {
                        
format(g_szBuffer150"SELECT `SubLeader` FROM `"MySQL_PLAYERS_TABLE"` WHERE pName = '%s' LIMIT 1"zname);
                        new 
Cache:Data mysql_query(dbHandle,g_szBuffer);
                        new 
Leading cache_get_field_content_int0"SubLeader" );
                        if(
Leading 0)
                        {
                            
SendError(playerid"ћaidėjas jau vadovauja frakcijai !");
                            
fChosen[playerid] = -1;
                            
fAction[playerid] = -1;
                        }
                        else
                        {
                        
                            
format(zinute148"{d8a9ff}•{ffffff} paskirtas naujasis „{d8a9ff}%s{ffffff}“ frakcijos sub-lyderis {d8a9ff}%s{ffffff} !"frakcija[fChosen[playerid]][fName], zname);
                            
SendClientMessageToAll(-1zinute);
                            
                            
format(g_szBuffer150,
                            
"UPDATE `"MySQL_PLAYERS_TABLE"` SET \
                            \
                                `SubLeader` = '%i' \
                            \
                            WHERE pName = '%s'"
,
                            
fChosen[playerid],
                            
zname);
                            
mysql_query(dbHandle,g_szBuffer);
                            
format(frakcija[fChosen[playerid]][fSubLeader], MAX_PLAYER_NAME+1"%s"zname);
                            
updateFractionLabel(fChosen[playerid]);
                            
fAction[playerid] = -1;
                            
fChosen[playerid] = -1;
                            
cache_deleteData );
                            return 
1;
                        }
                    }
                    else
                    {
                        
SendError(playerid"duomenų bazėje toks ћaidėjas neegzistuoja !");
                        
fAction[playerid] = 15;
                        
format(zinute90"Redaguojama „%s“ frakcija"frakcija[fChosen[playerid]][fName]);
                        
format(g_szBuffer170"{ffffff}Redaguojama „{d8a9ff}%s{ffffff}“ frakcija:\n \n    {d8a9ff}•{ffffff} atliekamas veiksmas %s,\n    {d8a9ff}•{ffffff} veiksmo informacija %s"frakcija[fChosen[playerid]][fName], getActionEdit(playerid), setActionInfo(playerid));
                        
ShowPlayerDialog(playerid855DIALOG_STYLE_MSGBOXzinuteg_szBuffer"Keisti""Atgal");
                    }
                    
cache_deletexData );
                }
             }
        }
        if(!
response)
        {    
            new 
ids;
            if(
player[playerid][pWorkLeader] >= && frakcija[player[playerid][pWorkLeader]][fReq] == 1){ 
                
ids player[playerid][pWorkLeader]; }
            else if(
player[playerid][pWorkSubLeader] >= && frakcija[player[playerid][pWorkLeader]][fReq] == 1){
                
ids player[playerid][pWorkSubLeader]; }
            if(
frakcija[ids][fReq] >= 0) return leaderDialog(playerid);
            if(
frakcija[id][fReq] != 1)
            {
                
fAction[playerid] = -1;
                
ShowPlayerDialog(playerid851DIALOG_STYLE_LISTzinute"{d8a9ff}•{ffffff} Keisti patirties reikalavimus\n{d8a9ff}•{ffffff} Keisti darbo vietų skaičių\n{d8a9ff}•{ffffff} Keisti dokumentų reikalavimus\n{d8a9ff}•{ffffff} Keisti teisių reikalavimus\n{d8a9ff}•{ffffff} keisti darbo kontrakto laiką""Rinktis""Iљeiti");
            }
            else
            {
                
fAction[playerid] = -1;
                
ShowPlayerDialog(playerid851DIALOG_STYLE_LISTzinute"{d8a9ff}•{ffffff} Keisti patirties reikalavimus\n{d8a9ff}•{ffffff} Keisti darbo vietų skaičių\n{d8a9ff}•{ffffff} Keisti dokumentų reikalavimus\n{d8a9ff}•{ffffff} Keisti teisių reikalavimus\n{d8a9ff}•{ffffff} keisti darbo kontrakto laiką\n \n{d8a9ff}•{ffffff} Frakcijos lyderio valdymas\n{d8a9ff}•{ffffff} Frakcijos sub-lyderio valdymas""Rinktis""Iљeiti");
            }
        }
    } 
Under this dialog goes all the responses.
Reply
#4

Still need help. - EDIT:
Fixed, didin't used -r in pawn file, to detect the line faster. Problem wasn't in dialogs, it was in one of the stocks, that is stocking info.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)