| Salve,oggi dopo un bel po di tempo che non utilizzavo pawno volevo riprendere il mio progetto fermo da tanto tempo.(:|) Inserisco nella mia gamemode il sistema registrazione(Tutto ok),appena inserisco il sistema login,sorgono quattro tipi di errori.(errore 17-25-33-35).
CODICE C:\Users\Toshiba\Desktop\Marco\Proggetto\gamemodes\SV-RP.pwn(119) : error 017: undefined symbol "RPName" C:\Users\Toshiba\Desktop\Marco\Proggetto\gamemodes\SV-RP.pwn(198) : error 025: function heading differs from prototype C:\Users\Toshiba\Desktop\Marco\Proggetto\gamemodes\SV-RP.pwn(208) : error 017: undefined symbol "ini_GetKey" C:\Users\Toshiba\Desktop\Marco\Proggetto\gamemodes\SV-RP.pwn(208) : error 033: array must be indexed (variable "keytmp") C:\Users\Toshiba\Desktop\Marco\Proggetto\gamemodes\SV-RP.pwn(211) : error 017: undefined symbol "ini_GetValue" C:\Users\Toshiba\Desktop\Marco\Proggetto\gamemodes\SV-RP.pwn(211) : error 033: array must be indexed (variable "valtmp") C:\Users\Toshiba\Desktop\Marco\Proggetto\gamemodes\SV-RP.pwn(214) : error 035: argument type mismatch (argument 2) C:\Users\Toshiba\Desktop\Marco\Proggetto\gamemodes\SV-RP.pwn(220) : error 017: undefined symbol "ini_GetKey" C:\Users\Toshiba\Desktop\Marco\Proggetto\gamemodes\SV-RP.pwn(220) : error 033: array must be indexed (variable "key") C:\Users\Toshiba\Desktop\Marco\Proggetto\gamemodes\SV-RP.pwn(221) : error 017: undefined symbol "ini_GetValue" C:\Users\Toshiba\Desktop\Marco\Proggetto\gamemodes\SV-RP.pwn(221) : error 033: array must be indexed (variable "val") C:\Users\Toshiba\Desktop\Marco\Proggetto\gamemodes\SV-RP.pwn(222) : error 017: undefined symbol "ini_GetValue" C:\Users\Toshiba\Desktop\Marco\Proggetto\gamemodes\SV-RP.pwn(222) : error 033: array must be indexed (variable "val") C:\Users\Toshiba\Desktop\Marco\Proggetto\gamemodes\SV-RP.pwn(223) : error 017: undefined symbol "ini_GetValue" C:\Users\Toshiba\Desktop\Marco\Proggetto\gamemodes\SV-RP.pwn(223) : error 033: array must be indexed (variable "val") C:\Users\Toshiba\Desktop\Marco\Proggetto\gamemodes\SV-RP.pwn(224) : error 017: undefined symbol "ini_GetValue" C:\Users\Toshiba\Desktop\Marco\Proggetto\gamemodes\SV-RP.pwn(224) : error 033: array must be indexed (variable "val") C:\Users\Toshiba\Desktop\Marco\Proggetto\gamemodes\SV-RP.pwn(225) : error 017: undefined symbol "ini_GetValue" C:\Users\Toshiba\Desktop\Marco\Proggetto\gamemodes\SV-RP.pwn(225) : error 033: array must be indexed (variable "val") C:\Users\Toshiba\Desktop\Marco\Proggetto\gamemodes\SV-RP.pwn(226) : error 017: undefined symbol "ini_GetValue" C:\Users\Toshiba\Desktop\Marco\Proggetto\gamemodes\SV-RP.pwn(226) : error 033: array must be indexed (variable "val") C:\Users\Toshiba\Desktop\Marco\Proggetto\gamemodes\SV-RP.pwn(227) : error 017: undefined symbol "ini_GetValue" C:\Users\Toshiba\Desktop\Marco\Proggetto\gamemodes\SV-RP.pwn(227) : error 033: array must be indexed (variable "val") C:\Users\Toshiba\Desktop\Marco\Proggetto\gamemodes\SV-RP.pwn(228) : error 017: undefined symbol "ini_GetValue" C:\Users\Toshiba\Desktop\Marco\Proggetto\gamemodes\SV-RP.pwn(228) : error 033: array must be indexed (variable "val") C:\Users\Toshiba\Desktop\Marco\Proggetto\gamemodes\SV-RP.pwn(229) : error 017: undefined symbol "ini_GetValue"
CODICE public OnPlayerLogin(playerid,password) { new string2[128]; format(string2, sizeof(string2), "Data/Account/%s.ini", nome); new File: UserFile = fopen(string2, io_read); if ( UserFile ) { new PassData[256]; new keytmp[256], valtmp[256]; fread( UserFile , PassData , sizeof( PassData ) ); keytmp = ini_GetKey( PassData ); if( strcmp( keytmp , "Key" , true ) == 0 ) { valtmp = ini_GetValue( PassData ); strmid(PInfo[playerid][pPassword], valtmp, 0, strlen(valtmp)-1, 255); } if(strcmp(PInfo[playerid][pPassword],password, true ) == 0 && strlen(password) > 0) { new key[ 256 ] , val[ 256 ]; new Data[ 256 ]; while ( fread( UserFile , Data , sizeof( Data ) ) ) { key = ini_GetKey( Data ); if( strcmp( key , "Nome" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pNome] = strval( val ); } if( strcmp( key , "Email" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pEmail] = strval( val ); } if( strcmp( key , "Ip" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pIp] = strval( val ); } if( strcmp( key , "IdHardware" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pIdHardware] = strval( val ); } if( strcmp( key , "Registrato" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pRegistrato] = strval( val ); } if( strcmp( key , "Sesso" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pSesso] = strval( val ); } if( strcmp( key , "Altezza" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pAltezza] = strval( val ); } if( strcmp( key , "Peso" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pPeso] = strval( val ); } if( strcmp( key , "Eta" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pEta] = strval( val ); } if( strcmp( key , "Livello" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pLivello] = strval( val ); } if( strcmp( key , "Exp" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pExp] = strval( val ); } if( strcmp( key , "Tutoriato" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pTutoriato] = strval( val ); } if( strcmp( key , "Staffer" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pStaffer] = strval( val ); } if( strcmp( key , "LivelloStaffer" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pStafferLivello] = strval( val ); } if( strcmp( key , "StafferinDuty" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pStafferDuty] = strval( val ); } if( strcmp( key , "VirtualWorld" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pVirtualWorld] = strval( val ); } if( strcmp( key , "Soldi" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pSoldi] = strval( val ); } if( strcmp( key , "ContoBancario" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pContoBancario] = strval( val ); } if( strcmp( key , "Donatore" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pDonatore] = strval( val ); } if( strcmp( key , "PatenteA" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pPatenteA] = strval( val ); } if( strcmp( key , "PatenteB" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pPatenteB] = strval( val ); } if( strcmp( key , "LicenzaNautica" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pLicenzaNautica] = strval( val ); } if( strcmp( key , "LicenzaVolo" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pLicenzaVolo] = strval( val ); } if( strcmp( key , "Products" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pProducts] = strval( val ); } if( strcmp( key , "Arrestato" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pArrestato] = strval( val ); } if( strcmp( key , "TempoArrestato" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pTempoArresto] = strval( val ); } if( strcmp( key , "Jailato" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pJailato] = strval( val ); } if( strcmp( key , "TempoJail" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pTempoJail] = strval( val ); } if( strcmp( key , "Ammanettato" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pAmmanettato] = strval( val ); } if( strcmp( key , "Bannato" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pBannato] = strval( val ); } if( strcmp( key , "AccountLockato" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pLockAccount] = strval( val ); } if( strcmp( key , "BanIp" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pBanIp] = strval( val ); } if( strcmp( key , "Loggato" , true ) == 0 ) { val = ini_GetValue( Data ); PInfo[playerid][pLoggato] = strval( val ); } } fclose(UserFile); return 1; } La prima riga è 198 e l'ultima 257.
In OnPlayerConnect
CODICE if(RPName(nome,first,last)) { GetPlayerName(playerid, nome, sizeof(nome)); format(stringa, sizeof(stringa), "Data/Account/%s.ini",nome); new File: hFile = fopen(stringa, io_read); if (hFile) { ShowPlayerDialog(playerid, login, DIALOG_STYLE_INPUT,"Login..","{FFFFFF}Metti la password per loggare.","Conferma","Esci"); } else { ShowPlayerDialog(playerid, registrazione, DIALOG_STYLE_INPUT,"Registrazione..","{FFFFFF}Inserisci una password per registrarti.","Conferma","Esci"); } } else { SendClientMessage(playerid,COLOR_RED,"[Kick]:{FFFFFF}Sei stato kickato dal bot motivo:Nome non RP. Es. Mario_Rossi"); SetTimerEx("KickNomeRP", 1000, false, "i", playerid); }
In fondo alla gamemode.
CODICE stock RPName(name[],ret_first[],ret_last[]) { new len = strlen(name), point = -1, bool:done = false; for(new i = 0; i < len; i++) { if(name[i] == '_') { if(point != -1) return 0; else { if(i == 0) return 0; point = i + 1; } } else if(point == -1) ret_first[i] = name[i]; else { ret_last[i - point] = name[i]; done = true; } } if(!done) return 0; return 1; }
stock ini_GetKey( line[] ) { new keyRes[128]; keyRes[0] = 0; if ( strfind( line , "=" , true ) == -1 ) return keyRes; strmid( keyRes , line , 0 , strfind( line , "=" , true ) , sizeof( keyRes) ); return keyRes; }
stock ini_GetValue( line[] ) { new valRes[128]; valRes[0]=0; if ( strfind( line , "=" , true ) == -1 ) return valRes; strmid( valRes , line , strfind( line , "=" , true )+1 , strlen( line ) , sizeof( valRes ) ); return valRes; }
Spero che mi potrete aiutare,se non avete capito domandate pure. |
|