Jump to content
  • 0

Erori compilare


Xcite

Question

Am mutat serverul samp pe baza de date mysql , si acum am cateva erori pe care nu stiu sa le rezolv...

error 017: undefined symbol "SQL_HOST"
error 032: array index out of bounds (variable "field") 
Aceste erori , la a2a am mai multe linii cu aceasta eroare . Am vreo 120 linii sau mai multe care folosesc field la mysql. Iar la prima e pus asa la inceput:
#define MYSQL_HOST "ip"
#define MYSQL_USER "user"
#define MYSQL_PASS "pass"
#define MYSQL_DB   "database"
#define MySQL: mysql_
Si mai am un warning , aparut doar dupa ce am mutat pe mysql..
warning 209: function "Streamer_OnPlayerConnect" should return a value

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

Cu Mysql_Host am rezolvat , dar warningul tot apare , am luat dinou streamer... pana sa nu mut pe mysql a mers bine , acum nu ..

Iar cu acele erori ce pot face ... am asa :

PlayerInfo[playerid][pLevel] = strval(field[3]);
 	    PlayerInfo[playerid][pAdmin] = strval(field[4]);
 	    PlayerInfo[playerid][pIP] = strval(field[5]);

Incepe cu 3 pentru ca 1 = parola si 2 = sqlid

Ce poate fi gresit ?

Link to comment
Share on other sites

Cu Mysql_Host am rezolvat , dar warningul tot apare , am luat dinou streamer... pana sa nu mut pe mysql a mers bine , acum nu ..

Iar cu acele erori ce pot face ... am asa :

PlayerInfo[playerid][pLevel] = strval(field[3]);
 	    PlayerInfo[playerid][pAdmin] = strval(field[4]);
 	    PlayerInfo[playerid][pIP] = strval(field[5]);
Incepe cu 3 pentru ca 1 = parola si 2 = sqlid Ce poate fi gresit ?
Pai si 0? Tine cont, ca intr-un array se incepe de la 0. Adica mereu o sa fie cu -1 valoarea pusa. De exemplu:
new Array[3]; //Numarul maxim care poti sa il pui e 2. Daca ii dai o valoare de 4, o sa fie 3 numarul maxim.
Array[0] = CreateObject(........);
Array[1] = CreateObject(........);
Array[2] = CreateObject(........); //Numarul maxim.

Working on:

-[FS]iTuning (With ALL components & Neons).

-[FS]iRadar (Advanced Speed Cameras).

Link to comment
Share on other sites

Am modificat si am pus de la 2 , adica sar peste 0 si 1 care e parola si sqlid , acestea le am doar la public AutoLogin si public OnPlayerLogin , postez aici autlogin , nu cred ca e complet ...  daca e gresit poate e lipsa ceva si imi ziceti ce sa adaug si la el si la onplayerlogin

public AutoLogin(playerid)
{
	new string[ 400 ] ;
	format(string,400,"SELECT * FROM `players` WHERE `username` = '%s'",ReturnName(playerid));
	MySQL:query(string);
	MySQL:store_result();
	if(MySQL:num_rows() != 0)
	{
        new row[128];
	    new field[125];

	    MySQL:fetch_row_format(row, "|");
	    explode(row, field, "|");
	    MySQL:free_result();


	    PlayerInfo[playerid][pLevel] = strval(field[2]);
 	    PlayerInfo[playerid][pAdmin] = strval(field[3]);
 	    PlayerInfo[playerid][pIP] = strval(field[4]);
 	    PlayerInfo[playerid][pHelper] = strval(field[5]);
 	    PlayerInfo[playerid][pHMuted] = strval(field[6]);
		PlayerInfo[playerid][pDonateRank] = strval(field[7]);
  		PlayerInfo[playerid][gPupgrade] = strval(field[8]);
 	    PlayerInfo[playerid][pConnectTime] = strval(field[9]);
 	    PlayerInfo[playerid][pReg] = strval(field[10]);
 	    PlayerInfo[playerid][pSex] = strval(field[11]);
 	    PlayerInfo[playerid][pAge] = strval(field[12]);
		PlayerInfo[playerid][pRobSkill] = strval(field[13]);
		PlayerInfo[playerid][pRob] = strval(field[14]);
 	    PlayerInfo[playerid][pOrigin] = strval(field[15]);
 	    PlayerInfo[playerid][pCK] = strval(field[16]);
 	    PlayerInfo[playerid][pMuted] = strval(field[17]);
 	    PlayerInfo[playerid][pMuteTime] = strval(field[18]);
		PlayerInfo[playerid][pExp] = strval(field[19]);
  		PlayerInfo[playerid][pCash] = strval(field[20]);
 	    PlayerInfo[playerid][pAccount] = strval(field[21]);
 	    PlayerInfo[playerid][pAccf] = strval(field[22]);
 	    PlayerInfo[playerid][pCrimes] = strval(field[23]);
 	    PlayerInfo[playerid][pKills] = strval(field[24]);
		PlayerInfo[playerid][pDeaths] = strval(field[25]);
  		PlayerInfo[playerid][pArrested] = strval(field[26]);
 	    PlayerInfo[playerid][pWantedDeaths] = strval(field[27]);
 	    PlayerInfo[playerid][pWantedLevel] = strval(field[28]);
 	    PlayerInfo[playerid][pWantedPoints] = strval(field[29]);
 	    PlayerInfo[playerid][pPhoneBook] = strval(field[30]);
		PlayerInfo[playerid][pLottoNr] = strval(field[31]);
	    PlayerInfo[playerid][pFishes] = strval(field[32]);
 	    PlayerInfo[playerid][pBiggestFish] = strval(field[33]);
 	    PlayerInfo[playerid][pJob] = strval(field[34]);
 	    PlayerInfo[playerid][pPayCheck] = strval(field[35]);
 	    PlayerInfo[playerid][pHeadValue] = strval(field[36]);
		PlayerInfo[playerid][pJailed] = strval(field[37]);
  		PlayerInfo[playerid][pJailTime] = strval(field[38]);
 	    PlayerInfo[playerid][pMats] = strval(field[39]);
 	    PlayerInfo[playerid][pDrugs] = strval(field[40]);
 	    PlayerInfo[playerid][pLeader] = strval(field[41]);
 	    PlayerInfo[playerid][pCLeader] = strval(field[42]);
		PlayerInfo[playerid][pMember] = strval(field[43]);
		PlayerInfo[playerid][pCMember] = strval(field[44]);
 	    PlayerInfo[playerid][pFMember] = strval(field[45]);
 	    PlayerInfo[playerid][pRank] = strval(field[46]);
 	    PlayerInfo[playerid][pCRank] = strval(field[47]);
 	    PlayerInfo[playerid][pChar] = strval(field[48]);
		PlayerInfo[playerid][pContractTime] = strval(field[49]);
  		PlayerInfo[playerid][pDetSkill] = strval(field[50]);
 	    PlayerInfo[playerid][pSexSkill] = strval(field[51]);
 	    PlayerInfo[playerid][pBoxSkill] = strval(field[52]);
 	    PlayerInfo[playerid][pLawSkill] = strval(field[53]);
 	    PlayerInfo[playerid][pMechSkill] = strval(field[54]);
		PlayerInfo[playerid][pJackSkill] = strval(field[55]);
  		PlayerInfo[playerid][pCarSkill] = strval(field[56]);
 	    PlayerInfo[playerid][pNewsSkill] = strval(field[57]);
 	    PlayerInfo[playerid][pDrugsSkill] = strval(field[58]);
 	    PlayerInfo[playerid][pCookSkill] = strval(field[59]);
 	    PlayerInfo[playerid][pFishSkill] = strval(field[60]);
		PlayerInfo[playerid][pHealth] = strval(field[61]);
   	    PlayerInfo[playerid][pSHealth] = strval(field[62]);
 	    PlayerInfo[playerid][pInt] = strval(field[63]);
 	    PlayerInfo[playerid][pLocal] = strval(field[64]);
		PlayerInfo[playerid][pTeam] = strval(field[65]);
	    PlayerInfo[playerid][pModel] = strval(field[66]);
 	    PlayerInfo[playerid][pPnumber] = strval(field[67]);
 	    PlayerInfo[playerid][pPhousekey] = strval(field[68]);
 	    PlayerInfo[playerid][pPcarkey] = strval(field[69]);
 	    PlayerInfo[playerid][pPcarkey2] = strval(field[70]);
		PlayerInfo[playerid][pPcarkey3] = strval(field[71]);
  		PlayerInfo[playerid][pGangKey] = strval(field[72]);
 	    PlayerInfo[playerid][pPbiskey] = strval(field[73]);
 	    PlayerInfo[playerid][pPos_x] = strval(field[74]);
 	    PlayerInfo[playerid][pPos_y] = strval(field[75]);
 	    PlayerInfo[playerid][pPos_z] = strval(field[76]);
		PlayerInfo[playerid][pTow] = strval(field[77]);
		PlayerInfo[playerid][pCarLic] = strval(field[78]);
 	    PlayerInfo[playerid][pFlyLic] = strval(field[79]);
 	    PlayerInfo[playerid][pBoatLic] = strval(field[80]);
 	    PlayerInfo[playerid][pFishLic] = strval(field[81]);
 	    PlayerInfo[playerid][pGunLic] = strval(field[82]);
		PlayerInfo[playerid][pPassport] = strval(field[83]);
  		PlayerInfo[playerid][pGun1] = strval(field[84]);
 	    PlayerInfo[playerid][pGun2] = strval(field[85]);
 	    PlayerInfo[playerid][pGun3] = strval(field[86]);
 	    PlayerInfo[playerid][pGun4] = strval(field[87]);
 	    PlayerInfo[playerid][pAmmo1] = strval(field[88]);
		PlayerInfo[playerid][pAmmo2] = strval(field[89]);
  		PlayerInfo[playerid][pAmmo3] = strval(field[90]);
 	    PlayerInfo[playerid][pAmmo4] = strval(field[91]);
 	    PlayerInfo[playerid][pCarTime] = strval(field[92]);
 	    PlayerInfo[playerid][pPayDay] = strval(field[93]);
 	    PlayerInfo[playerid][pPayDayHad] = strval(field[94]);
		PlayerInfo[playerid][pWatch] = strval(field[95]);
 	    PlayerInfo[playerid][pCrashed] = strval(field[96]);
 	    PlayerInfo[playerid][pWins] = strval(field[97]);
 	    PlayerInfo[playerid][pLoses] = strval(field[98]);
		PlayerInfo[playerid][pAlcoholPerk] = strval(field[199]);
  		PlayerInfo[playerid][pDrugPerk] = strval(field[100]);
 	    PlayerInfo[playerid][pMiserPerk] = strval(field[101]);
 	    PlayerInfo[playerid][pPainPerk] = strval(field[102]);
 	    PlayerInfo[playerid][pTraderPerk] = strval(field[103]);
 	    PlayerInfo[playerid][pTut] = strval(field[104]);
		PlayerInfo[playerid][pMissionNr] = strval(field[105]);
		PlayerInfo[playerid][pWarns] = strval(field[106]);
 	    PlayerInfo[playerid][pFwarns] = strval(field[107]);
 	    PlayerInfo[playerid][pVirWorld] = strval(field[108]);
 	    PlayerInfo[playerid][pFuel] = strval(field[109]);
 	    PlayerInfo[playerid][pMarried] = strval(field[110]);
		PlayerInfo[playerid][pMarriedTo] = strval(field[111]);
  		PlayerInfo[playerid][pFishTool] = strval(field[112]);
 	    PlayerInfo[playerid][pInvWeapon] = strval(field[113]);
 	    PlayerInfo[playerid][pInvAmmo] = strval(field[114]);
 	    PlayerInfo[playerid][pLighter] = strval(field[115]);
 	    PlayerInfo[playerid][pCigarettes] = strval(field[116]);
		PlayerInfo[playerid][pRequestingBackup] = strval(field[117]);
  		PlayerInfo[playerid][pRoadblock] = strval(field[118]);
 	    PlayerInfo[playerid][pMask] = strval(field[119]);
 	    PlayerInfo[playerid][pMaskuse] = strval(field[120]);
 	    PlayerInfo[playerid][pHideNumber] = strval(field[121]);
 	    PlayerInfo[playerid][pSpeaker] = strval(field[122]);
		PlayerInfo[playerid][pLocked] = strval(field[123]);
		PlayerInfo[playerid][pPunish] = strval(field[124]);
		GivePlayerMoney(playerid,PlayerInfo[playerid][pCash]);
	}
    SendClientMessage(playerid, 0xAFAFAFAA, "{FF0000}MySQL:{FFFFFF} You were automatically logged.");
    gPlayerLogged[playerid] = 1;
	return 1;
}
EDIT: Acum apare doar:
error 048: array dimensions do not match
error 048: array dimensions do not match

2 erori la fel.. in 2 locuri ( public onplayerlogin si public autologin la field .. )

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.