Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: FireMan poslato Jul 04, 2011, 12:35:38 POSLE PODNE

Naslov: [Pomoc]Errori
Poruka od: FireMan poslato Jul 04, 2011, 12:35:38 POSLE PODNE
Skripta:MojMod od 0
Opis Problema:Kad sam ubacivao da mi u MySQL da mi sprema admin i GM level dobio sam errore
Dio Skripte:if(dialogid == 15000)
    {
       if(response)
       {
           new Query[200], Pname[24];
           GetPlayerName(playerid, Pname, 24);
           new escpname[24];
           mysql_real_escape_string(Pname, escpname);
           format(Query, sizeof(Query), "SELECT * FROM `playerinfo` WHERE `user` = '%s' AND `password` = '%s'", escpname, inputtext);
           mysql_query(Query);
           mysql_store_result();
           if(!mysql_num_rows())
           {
               SendClientMessage(playerid, 0xF60000AA, "Invalid password!");
               SetPVarInt(playerid, "WrongPass", GetPVarInt(playerid, "WrongPass") + 1);
               ShowPlayerDialog(playerid, 15000, DIALOG_STYLE_INPUT , "Login", "This account is registered, please login", "OK", "Cancel");
               if(GetPVarInt(playerid, "WrongPass") == 3)
               {
                   SendClientMessage(playerid, 0xF60000AA, "Max password tries exceeded!!");
                   Kick(playerid);
               }
           }
           else
           {
               new line[750]; //I know it's big D=
               if(mysql_fetch_row(line)) //Fetches the line
               {
                   new data[3][50]; //The data strings
                   new data2[4]; //The data variables
                   sscanf(line, "p|ssdddds", data[0], data[1], data2[0], data2[1], data2[2], data2[3], data[2], data[3], data[4]); // linija 268
                   SetPVarInt(playerid, "Kills", data2[0]); //Sets Pvar ints
                   SetPVarInt(playerid, "Logged", 1); //Sets Pvar ints
                   SetPVarInt(playerid, "Deaths", data2[1]); //Sets Pvar ints
                   SetPlayerScore(playerid, data2[2]); //Sets players score
                   SetPVarInt(playerid, "MoneyGiven", data2[3]); //Sets players cash
                   SetPVarInt(playerid, "Admin", data[3]); //linija 274
                   SetPVarInt(playerid, "GameMaster", data[4]); //linija 275
                   SendClientMessage(playerid, 0x0000D9AA, "Prijavljen!");
                   mysql_free_result();
               }
           }
       }
    }
    return 1;
}


Errori...

C:\Users\Sa-Mp\Desktop\BNRP\gamemodes\MojMod.pwn(268) : error 032: array index out of bounds (variable "data")
C:\Users\Sa-Mp\Desktop\BNRP\gamemodes\MojMod.pwn(274) : error 032: array index out of bounds (variable "data")
C:\Users\Sa-Mp\Desktop\BNRP\gamemodes\MojMod.pwn(275) : error 032: array index out of bounds (variable "data")
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.
Naslov: Odg: [Pomoc]Errori
Poruka od: System32 poslato Jul 04, 2011, 12:37:25 POSLE PODNE
linije?
Naslov: Odg: [Pomoc]Errori
Poruka od: Zarathos poslato Jul 04, 2011, 12:39:49 POSLE PODNE
Stavi umjesto new data[3][50]; //The data strings

ovo:

new data[10][50]; //The data strings
Naslov: Odg: [Pomoc]Errori
Poruka od: FireMan poslato Jul 04, 2011, 12:49:04 POSLE PODNE
Sad su samo ove dvije zadnje linije a errori su

C:\Users\Sa-Mp\Desktop\BNRP\gamemodes\MojMod.pwn(274) : error 035: argument type mismatch (argument 3)
C:\Users\Sa-Mp\Desktop\BNRP\gamemodes\MojMod.pwn(275) : error 035: argument type mismatch (argument 3)
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Naslov: Odg: [Pomoc]Errori
Poruka od: System32 poslato Jul 04, 2011, 12:52:27 POSLE PODNE
imas tut u pdf tutoriali za taj warn pa sam rjesi!
Naslov: Odg: [Pomoc]Errori
Poruka od: FireMan poslato Jul 04, 2011, 12:58:16 POSLE PODNE
Citaj malo,to je Error
Naslov: Odg: [Pomoc]Errori
Poruka od: Zarathos poslato Jul 04, 2011, 12:59:22 POSLE PODNE
daj te linije
Naslov: Odg: [Pomoc]Errori
Poruka od: System32 poslato Jul 04, 2011, 13:05:14 POSLE PODNE
to je isto sto i number of arguments does not match the definition, da ima eng.bar 3 znao bi sto znaci
Naslov: Odg: [Pomoc]Errori
Poruka od: FireMan poslato Jul 04, 2011, 13:15:57 POSLE PODNE
Argument Type Missmatch
Naslov: Odg: [Pomoc]Errori
Poruka od: Zarathos poslato Jul 04, 2011, 13:17:19 POSLE PODNE
To je fulio deklaraciju, tj. stavio je npr. float vrijednost gdje treba integer i sl.
i sada daj kod da vidim sta je :S
Naslov: Odg: [Pomoc]Errori
Poruka od: [TG:RP]$--L84S--$ poslato Jul 04, 2011, 13:17:27 POSLE PODNE
Dobro postaj te linije an kojem ti izbaci to.
Naslov: Odg: [Pomoc]Errori
Poruka od: FireMan poslato Jul 04, 2011, 13:21:18 POSLE PODNE
RIJESIO MOZE LOCK


Koristio sam string umjesto varijable
Naslov: Odg: [Pomoc]Errori
Poruka od: Zarathos poslato Jul 04, 2011, 13:25:26 POSLE PODNE
evo ti rijeseno:

sscanf(line, "p<|>dddddd", data[0], data[1], data[2], data[3], data[4], data[5]); // linija 268
SetPVarInt(playerid, "Kills", data[0]); //Sets Pvar ints 
SetPVarInt(playerid, "Logged", 1); //Sets Pvar ints 
SetPVarInt(playerid, "Deaths", data[1]); //Sets Pvar ints 
SetPlayerScore(playerid, data[2]); //Sets players score 
SetPVarInt(playerid, "MoneyGiven", data[3]); //Sets players cash 
SetPVarInt(playerid, "Admin", data[4]); //linija 274 
SetPVarInt(playerid, "GameMaster", data[5]); //linija 275