Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×
  • 0

../include/gl_common.inc(83) : warning 219: local variable "result" shadows a variable at a preceding level


Question

Posted

Problema intalnita (descriere):Am trecut biz-urile pe mysql r39-3 si am adaugat
Imagini / Video (optional):-
Ati incercat sa rezolvati singur?:Da

new Handle;
new Cache:result;
 si imi da eroarea aia in include ....
Ero(area / rile) / warning-(ul / urile):../include/gl_common.inc(83) : warning 219: local variable "result" shadows a variable at a preceding level
Liniile de cod / sursa / script-ul(obligatoriu):
public LoadBizz()
{
   new i, query[256], index;
    mysql_format(Handle, query, sizeof(query), "SELECT * FROM `bizz` ORDER BY `bizz`.`ID` ASC");
    result = mysql_query(Handle, query);
    while(cache_get_row_count(Handle))
    {
      i++;
        BizzInfo[i][bOwned] = cache_get_field_content_int(i, "Owned");
           cache_get_field_content(i, "Owner", BizzInfo[i][bOwner]);
        cache_get_field_content(i, "Message", BizzInfo[i][bMessage]);
           cache_get_field_content(i, "Extortion", BizzInfo[i][bExtortion]);
        BizzInfo[i][bEntranceX] = cache_get_field_content_float (i, "EntX");
        BizzInfo[i][bEntranceY] = cache_get_field_content_float (i, "EntY");
        BizzInfo[i][bEntranceZ] = cache_get_field_content_float (i, "EntZ");
        BizzInfo[i][bExitX] = cache_get_field_content_float (i, "ExitX");
        BizzInfo[i][bExitY] = cache_get_field_content_float (i, "ExitY");
        BizzInfo[i][bExitZ] = cache_get_field_content_float (i, "ExitZ");
        BizzInfo[i][bLevelNeeded] = cache_get_field_content_int(i, "Level");
        BizzInfo[i][bBuyPrice] = cache_get_field_content_int(i, "Price");
        BizzInfo[i][bEntranceCost] = cache_get_field_content_int(i, "EPrice");
        BizzInfo[i][bTill] = cache_get_field_content_int(i, "Till");
        BizzInfo[i][bLocked] = cache_get_field_content_int(i, "Locked");
        BizzInfo[i][bInterior] = cache_get_field_content_int(i, "Interior");
        BizzInfo[i][bProducts] = cache_get_field_content_int(i, "Products");
        BizzInfo[i][bMaxProducts] = cache_get_field_content_int(i, "MaxProducts");
        BizzInfo[i][bPriceProd] = cache_get_field_content_int(i, "ProductPrice");
   }
   cache_delete(Handle);
   printf("[BIZZ]Au fost incarcate %d bizz-uri.Felicitari pentru reusita.[PG-ZONE.RO]", index);
   return 1;
}
public LoadSBizz()
{
   new i, query[256], index;
    mysql_format(Handle, query, sizeof(query), "SELECT * FROM `sbizz` ORDER BY `sbizz`.`ID` ASC");
    result = mysql_query(Handle, query);
    while(cache_get_row_count(Handle))
    {
      i++;
        SBizzInfo[i][sbOwned] = cache_get_field_content_int(i, "Owned");
        cache_get_field_content(i, "Owner", SBizzInfo[i][sbOwner]);
        cache_get_field_content(i, "Message", SBizzInfo[i][sbMessage]);
        cache_get_field_content(i, "Extortion", SBizzInfo[i][sbExtortion]);
        SBizzInfo[i][sbEntranceX] = cache_get_field_content_float (i, "EntX");
        SBizzInfo[i][sbEntranceY] = cache_get_field_content_float (i, "EntY");
        SBizzInfo[i][sbEntranceZ] = cache_get_field_content_float (i, "EntZ");
        SBizzInfo[i][sbExitX] = cache_get_field_content_float (i, "ExitX");
        SBizzInfo[i][sbExitY] = cache_get_field_content_float (i, "ExitY");
        SBizzInfo[i][sbExitZ] = cache_get_field_content_float (i, "ExitZ");
        SBizzInfo[i][sbLevelNeeded] = cache_get_field_content_int(i, "Level");
        SBizzInfo[i][sbBuyPrice] = cache_get_field_content_int(i, "Price");
        SBizzInfo[i][sbEntranceCost] = cache_get_field_content_int(i, "EPrice");
        SBizzInfo[i][sbTill] = cache_get_field_content_int(i, "Till");
        SBizzInfo[i][sbLocked] = cache_get_field_content_int(i, "Locked");
        SBizzInfo[i][sbInterior] = cache_get_field_content_int(i, "Interior");
        SBizzInfo[i][sbProducts] = cache_get_field_content_int(i, "Products");
        SBizzInfo[i][sbMaxProducts] = cache_get_field_content_int(i, "MaxProducts");
        SBizzInfo[i][sbPriceProd] = cache_get_field_content_int(i, "ProductPrice");
   }
   cache_delete(Handle);
   printf("[SBIZZ]Au fost incarcate %d sbizz-uri.Felicitari pentru reusita.[PG-ZONE.RO]", index);
   return 1;
}

 

Problema intalnita (descriere):
Ero(area / rile) / warning-(ul / urile):
Liniile de cod / sursa / script-ul(obligatoriu):
Imagini / Video (optional):
Ati incercat sa rezolvati singur?:

14 answers to this question

Recommended Posts

  • 0
Posted

pai daca sterg

new Cache:result;

imi da C:\Users\Jimmi\Desktop\93.119.25.182-7777\gamemodes\RunStrike.pwn(11731) : error 017: undefined symbol "result"
C:\Users\Jimmi\Desktop\93.119.25.182-7777\gamemodes\RunStrike.pwn(11760) : warning 213: tag mismatch
C:\Users\Jimmi\Desktop\93.119.25.182-7777\gamemodes\RunStrike.pwn(11771) : error 017: undefined symbol "result"
C:\Users\Jimmi\Desktop\93.119.25.182-7777\gamemodes\RunStrike.pwn(11800) : warning 213: tag mismatch

 

erorile cu tag mismatch sunt aici

   cache_delete(Handle);

  • 0
Posted (edited)

Mai am o problema.Am incercat sa trec un dialog pe mysql r39-3(mai am mult pana sa se termin gm)

si imi da erorile astea:

C:\Users\Jimmi\Desktop\93.119.25.182-7777\gamemodes\RunStrike.pwn(12120) : error 017: undefined symbol "MySQL"
C:\Users\Jimmi\Desktop\93.119.25.182-7777\gamemodes\RunStrike.pwn(12121) : error 017: undefined symbol "tquery"
C:\Users\Jimmi\Desktop\93.119.25.182-7777\gamemodes\RunStrike.pwn(12122) : error 017: undefined symbol "MySQL"
C:\Users\Jimmi\Desktop\93.119.25.182-7777\gamemodes\RunStrike.pwn(12123) : error 017: undefined symbol "tquery"
C:\Users\Jimmi\Desktop\93.119.25.182-7777\gamemodes\RunStrike.pwn(12142) : error 017: undefined symbol "MySQL"
C:\Users\Jimmi\Desktop\93.119.25.182-7777\gamemodes\RunStrike.pwn(12143) : error 017: undefined symbol "tquery"
C:\Users\Jimmi\Desktop\93.119.25.182-7777\gamemodes\RunStrike.pwn(12144) : error 017: undefined symbol "MySQL"
C:\Users\Jimmi\Desktop\93.119.25.182-7777\gamemodes\RunStrike.pwn(12145) : error 017: undefined symbol "tquery"
C:\Users\Jimmi\Desktop\93.119.25.182-7777\gamemodes\RunStrike.pwn(12169) : error 017: undefined symbol "MySQL"
C:\Users\Jimmi\Desktop\93.119.25.182-7777\gamemodes\RunStrike.pwn(12170) : error 017: undefined symbol "tquery"
C:\Users\Jimmi\Desktop\93.119.25.182-7777\gamemodes\RunStrike.pwn(12171) : error 017: undefined symbol "MySQL"
C:\Users\Jimmi\Desktop\93.119.25.182-7777\gamemodes\RunStrike.pwn(12172) : error 017: undefined symbol "tquery"

Codul vechi arata asa:

if(dialogid == 130)
		{
		    if(!response)
            {
                return 1;
            }
		    switch(listitem)
            {
                case 0:
                {
		            if(PlayerInfo[playerid][pGPPoints] >= 150)
		            {
		                PlayerInfo[playerid][pDonateRank] = 1;
		                PlayerInfo[playerid][pGPPoints] -= 150;
		                format(string, sizeof(string), "UPDATE players SET DonateRank='%d' WHERE id=%d", PlayerInfo[playerid][pDonateRank], PlayerInfo[playerid][pSQLID]);
						mysql_query(string);
		                format(string, sizeof(string), "UPDATE players SET GamePoints='%d' WHERE id=%d", PlayerInfo[playerid][pGPPoints], PlayerInfo[playerid][pSQLID]);
						mysql_query(string);
		                SendClientMessage(playerid, -1, "Felicitari! Ai achizitionat 'Cont VIP' in schimbul a 150 {FF8C00}GamePoints{FFFFFF}!");
		                SendClientMessage(playerid, -1, "Tasteaza /desprevip pentru informatii!");
		                return 1;
					}
					else
					{
						SendClientMessage(playerid, -1, "Nu detii 150 {FF8C00}GamePoints{FFFFFF}!");
						return 1;
					}
				}
				case 1:
				{
				    if(PlayerInfo[playerid][pGPPoints] >= 20)
		            {
		                if(PlayerInfo[playerid][pWarns] > 0)
		                {
			                PlayerInfo[playerid][pWarns] = 0;
			                PlayerInfo[playerid][pGPPoints] -= 20;
			                format(string, sizeof(string), "UPDATE players SET GamePoints='%d' WHERE id=%d", PlayerInfo[playerid][pGPPoints], PlayerInfo[playerid][pSQLID]);
							mysql_query(string);
							format(string, sizeof(string), "UPDATE players SET Warnings='%d' WHERE id=%d", PlayerInfo[playerid][pWarns], PlayerInfo[playerid][pSQLID]);
							mysql_query(string);
			                SendClientMessage(playerid, -1, "Felicitari! Ai achizitionat 'Clear Warns' in schimbul a 20 {FF8C00}GamePoints{FFFFFF}!");
			                return 1;
						}
						else
						{
						    SendClientMessage(playerid, -1 ,"Nu ai warn-uri!");
						    return 1;
						}
					}
					else
					{
						SendClientMessage(playerid, -1, "Nu detii 20 {FF8C00}GamePoints{FFFFFF}!");
						return 1;
					}
				}
				case 2:
				{
				    if(PlayerInfo[playerid][pGPPoints] >= 40)
		            {
		                if(PlayerInfo[playerid][pPunish] > 0)
		                {
			                PlayerInfo[playerid][pPunish] = 0;
			                PlayerInfo[playerid][pGPPoints] -= 40;
			                format(string, sizeof(string), "UPDATE players SET GamePoints='%d' WHERE id=%d", PlayerInfo[playerid][pGPPoints], PlayerInfo[playerid][pSQLID]);
							mysql_query(string);
							format(string, sizeof(string), "UPDATE players SET Fpunish='%d' WHERE id=%d", PlayerInfo[playerid][pPunish], PlayerInfo[playerid][pSQLID]);
							mysql_query(string);
			                SendClientMessage(playerid, -1, "Felicitari! Ai achizitionat 'Clear FPunish' in schimbul a 40 {FF8C00}GamePoints{FFFFFF}!");
			                return 1;
						}
						else
						{
						    SendClientMessage(playerid, -1 ,"Nu ai FPunish!");
						    return 1;
						}
					}
					else
					{
						SendClientMessage(playerid, -1, "Nu detii 40 {FF8C00}GamePoints{FFFFFF}!");
						return 1;
				}
	        }
		}
	}

Si eu am facut dupa:http://wiki.sa-mp.com/wiki/MySQL/R33#mysql_query si a rezultat asta:

if(dialogid == 130)
		{
		    if(!response)
            {
                return 1;
            }
		    switch(listitem)
            {
                case 0:
                {
		            if(PlayerInfo[playerid][pGPPoints] >= 150)
		            {
		                PlayerInfo[playerid][pDonateRank] = 1;
		                PlayerInfo[playerid][pGPPoints] -= 150;
                  		mysql_tquery(MySQL, "UPDATE players SET DonateRank='%d' WHERE id=%d", "");
		                mysql_tquery(tquery);
		                mysql_tquery(MySQL, "UPDATE players SET GamePoints='%d' WHERE id=%d", "");
               			mysql_tquery(tquery);
		                SendClientMessage(playerid, -1, "Felicitari! Ai achizitionat 'Cont VIP' in schimbul a 150 {FF8C00}GamePoints{FFFFFF}!");
		                SendClientMessage(playerid, -1, "Tasteaza /desprevip pentru informatii!");
		                return 1;
					}
					else
					{
						SendClientMessage(playerid, -1, "Nu detii 150 {FF8C00}GamePoints{FFFFFF}!");
						return 1;
					}
				}
				case 1:
				{
				    if(PlayerInfo[playerid][pGPPoints] >= 20)
		            {
		                if(PlayerInfo[playerid][pWarns] > 0)
		                {
			                PlayerInfo[playerid][pWarns] = 0;
			                PlayerInfo[playerid][pGPPoints] -= 20;
			                mysql_tquery(MySQL, "UPDATE players SET GamePoints='%d' WHERE id=%d", "");
			                mysql_tquery(tquery);
			                mysql_tquery(MySQL, "UPDATE players SET Warnings='%d' WHERE id=%d", "");
	               			mysql_tquery(tquery);
			                SendClientMessage(playerid, -1, "Felicitari! Ai achizitionat 'Clear Warns' in schimbul a 20 {FF8C00}GamePoints{FFFFFF}!");
			                return 1;
						}
						else
						{
						    SendClientMessage(playerid, -1 ,"Nu ai warn-uri!");
						    return 1;
						}
					}
					else
					{
						SendClientMessage(playerid, -1, "Nu detii 20 {FF8C00}GamePoints{FFFFFF}!");
						return 1;
					}
				}
				case 2:
				{
				    if(PlayerInfo[playerid][pGPPoints] >= 40)
		            {
		                if(PlayerInfo[playerid][pPunish] > 0)
		                {
			                PlayerInfo[playerid][pPunish] = 0;
			                PlayerInfo[playerid][pGPPoints] -= 40;
       						mysql_tquery(MySQL, "UPDATE players SET GamePoints='%d' WHERE id=%d", "");
			                mysql_tquery(tquery);
			                mysql_tquery(MySQL, "UPDATE players SET Fpunish='%d' WHERE id=%d", "");
	               			mysql_tquery(tquery);
			                SendClientMessage(playerid, -1, "Felicitari! Ai achizitionat 'Clear FPunish' in schimbul a 40 {FF8C00}GamePoints{FFFFFF}!");
			                return 1;
						}
						else
						{
						    SendClientMessage(playerid, -1 ,"Nu ai FPunish!");
						    return 1;
						}
					}
					else
					{
						SendClientMessage(playerid, -1, "Nu detii 40 {FF8C00}GamePoints{FFFFFF}!");
						return 1;
				}
	        }
		}
	}
Edited by jimmi
  • 0
  • 0
Posted

Acuma este corect?

if(dialogid == 130)
        {
            if(!response)
            {
                return 1;
            }
            switch(listitem)
            {
                case 0:
                {
                    if(PlayerInfo[playerid][pGPPoints] >= 150)
                    {
                        PlayerInfo[playerid][pDonateRank] = 1;
                        PlayerInfo[playerid][pGPPoints] -= 150;
                          format(string, sizeof(string), "UPDATE players SET DonateRank='%d' WHERE id=%d", "");
                        mysql_tquery(handle, string);
                        format(string, sizeof(string), "UPDATE players SET GamePoints='%d' WHERE id=%d", "");
                          mysql_tquery(handle, string);
                        SendClientMessage(playerid, -1, "Felicitari! Ai achizitionat 'Cont VIP' in schimbul a 150 {FF8C00}GamePoints{FFFFFF}!");
                        SendClientMessage(playerid, -1, "Tasteaza /desprevip pentru informatii!");
                        return 1;
                    }
                    else
                    {
                        SendClientMessage(playerid, -1, "Nu detii 150 {FF8C00}GamePoints{FFFFFF}!");
                        return 1;
                    }
                }
                case 1:
                {
                    if(PlayerInfo[playerid][pGPPoints] >= 20)
                    {
                        if(PlayerInfo[playerid][pWarns] > 0)
                        {
                            PlayerInfo[playerid][pWarns] = 0;
                            PlayerInfo[playerid][pGPPoints] -= 20;
                            format(string, sizeof(string), "UPDATE players SET GamePoints='%d' WHERE id=%d", "");
                            mysql_tquery(handle, string);
                            format(string, sizeof(string), "UPDATE players SET Warnings='%d' WHERE id=%d", "");
                               mysql_tquery(handle, string);
                            SendClientMessage(playerid, -1, "Felicitari! Ai achizitionat 'Clear Warns' in schimbul a 20 {FF8C00}GamePoints{FFFFFF}!");
                            return 1;
                        }
                        else
                        {
                            SendClientMessage(playerid, -1 ,"Nu ai warn-uri!");
                            return 1;
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, -1, "Nu detii 20 {FF8C00}GamePoints{FFFFFF}!");
                        return 1;
                    }
                }
                case 2:
                {
                    if(PlayerInfo[playerid][pGPPoints] >= 40)
                    {
                        if(PlayerInfo[playerid][pPunish] > 0)
                        {
                            PlayerInfo[playerid][pPunish] = 0;
                            PlayerInfo[playerid][pGPPoints] -= 40;
                               format(string, sizeof(string), "UPDATE players SET GamePoints='%d' WHERE id=%d", "");
                            mysql_tquery(handle, string);
                            format(string, sizeof(string), "UPDATE players SET Fpunish='%d' WHERE id=%d", "");
                               mysql_tquery(handle, string);
                            SendClientMessage(playerid, -1, "Felicitari! Ai achizitionat 'Clear FPunish' in schimbul a 40 {FF8C00}GamePoints{FFFFFF}!");
                            return 1;
                        }
                        else
                        {
                            SendClientMessage(playerid, -1 ,"Nu ai FPunish!");
                            return 1;
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, -1, "Nu detii 40 {FF8C00}GamePoints{FFFFFF}!");
                        return 1;
                }
            }
        }
    }
  • 0
  • 0
  • 0
  • 0
Posted

pana la urma ma poae ajuta cineva sa imi spuna/faca cum e corect?

Oricare dintre format si mysql_format e corect.

e ok, DAR cand apeleaza la mysql_format apeleaza la conexiunea la baza de date si asta e recomandat

format e cel mai utilizat

242086.png

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.