Jump to content
  • 0

modificare sql


custura

Question

Problema: PAWN COMPILER

Cod sursa: 
pastebin.com/27uMbKDB

Erori/atentionari: 
C:\Users\Custura\Desktop\GalacticRP v1 like H\gamemodes\galacticrp.pwn(4884) : error 017: undefined symbol "mysql_store_result"
C:\Users\Custura\Desktop\GalacticRP v1 like H\gamemodes\galacticrp.pwn(4885) : error 017: undefined symbol "mysql_retrieve_row"
C:\Users\Custura\Desktop\GalacticRP v1 like H\gamemodes\galacticrp.pwn(4889) : error 017: undefined symbol "mysql_get_field"
C:\Users\Custura\Desktop\GalacticRP v1 like H\gamemodes\galacticrp.pwn(4890) : error 017: undefined symbol "mysql_get_field"
C:\Users\Custura\Desktop\GalacticRP v1 like H\gamemodes\galacticrp.pwn(4891) : error 017: undefined symbol "mysql_get_field"
C:\Users\Custura\Desktop\GalacticRP v1 like H\gamemodes\galacticrp.pwn(4892) : error 017: undefined symbol "mysql_get_field"
C:\Users\Custura\Desktop\GalacticRP v1 like H\gamemodes\galacticrp.pwn(4893) : error 017: undefined symbol "mysql_get_field"
C:\Users\Custura\Desktop\GalacticRP v1 like H\gamemodes\galacticrp.pwn(4894) : error 017: undefined symbol "mysql_get_field"
C:\Users\Custura\Desktop\GalacticRP v1 like H\gamemodes\galacticrp.pwn(4895) : error 017: undefined symbol "mysql_get_field"
C:\Users\Custura\Desktop\GalacticRP v1 like H\gamemodes\galacticrp.pwn(4897) : error 017: undefined symbol "mysql_free_result"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase

Imagine/video: - 
Alte detalii: in pastebin "public LoadTurfs()" e cel care imi da erori
Trebuie sa il modific ca "public Detector_Load()" dar nu stiu cum sa o fac, orice informatie sau ajutor imi e util, multumesc!

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0
public LoadTurfs()
{
    static
        rows,
        fields,
        index;
 
    cache_get_data(rows, fields, g_iHandle);
 
    for (new i = 0; i < rows; i ++) {
        index = cache_get_field_int(i, "ID");
                             
        TurfInfo[index][zID] = index;
        TurfInfo[index][zOwned] = cache_get_field_int(i, "Owned");
        TurfInfo[index][zTime] = cache_get_field_int(i, "Time");          
        TurfInfo[index][zMinX] = cache_get_field_float(i, "MinX");          
        TurfInfo[index][zMinY] = cache_get_field_float(i, "MinY");
        TurfInfo[index][zMaxX] = cache_get_field_float(i, "MaxX");
        TurfInfo[index][zMaxY] = cache_get_field_float(i, "MaxY");
    }
 
    printf("[MySQL Turfs]: %d", rows);
    return 1;
}

 

Link to comment
Share on other sites

  • 0
Acum 2 ore, BuNiCu-RP a spus:

Salut, Incearca asa:

https://pastebin.com/5qjqtgih 

C:\Users\Custura\Desktop\GalacticRP v1 like H\gamemodes\galacticrp.pwn(4896) : warning 219: local variable "i" shadows a variable at a preceding level
C:\Users\Custura\Desktop\GalacticRP v1 like H\gamemodes\galacticrp.pwn(4897) : warning 202: number of arguments does not match definition
C:\Users\Custura\Desktop\GalacticRP v1 like H\gamemodes\galacticrp.pwn(4899) : warning 202: number of arguments does not match definition
C:\Users\Custura\Desktop\GalacticRP v1 like H\gamemodes\galacticrp.pwn(4900) : warning 202: number of arguments does not match definition
C:\Users\Custura\Desktop\GalacticRP v1 like H\gamemodes\galacticrp.pwn(4901) : warning 202: number of arguments does not match definition
C:\Users\Custura\Desktop\GalacticRP v1 like H\gamemodes\galacticrp.pwn(4902) : warning 202: number of arguments does not match definition
C:\Users\Custura\Desktop\GalacticRP v1 like H\gamemodes\galacticrp.pwn(4903) : warning 202: number of arguments does not match definition
C:\Users\Custura\Desktop\GalacticRP v1 like H\gamemodes\galacticrp.pwn(4904) : warning 202: number of arguments does not match definition

 

Daca pun cum ai dat tu

Link to comment
Share on other sites

  • 0
Acum 10 minute, BuNiCu-RP a spus:

public LoadTurfs()
{
    static
        rows,
        fields,
        index;
 
    cache_get_data(rows, fields, g_iHandle);
 
    for (new i = 0; i < rows; i ++) {
        index = cache_get_field_int(i, "ID");
                             
        TurfInfo[index][zID] = index;
        TurfInfo[index][zOwned] = cache_get_field_int(i, "Owned");
        TurfInfo[index][zTime] = cache_get_field_int(i, "Time");          
        TurfInfo[index][zMinX] = cache_get_field_float(i, "MinX");          
        TurfInfo[index][zMinY] = cache_get_field_float(i, "MinY");
        TurfInfo[index][zMaxX] = cache_get_field_float(i, "MaxX");
        TurfInfo[index][zMaxY] = cache_get_field_float(i, "MaxY");
    }
 
    printf("[MySQL Turfs]: %d", rows);
    return 1;
}

 

Cand folosesc comanda /attack

[11:06:19] [debug] Run time error 4: "Array index out of bounds"
[11:06:19] [debug]  Accessing element at index 49 past array upper bound 48
[11:06:19] [debug] AMX backtrace:
[11:06:19] [debug] #0 00067dc8 in public IsPlayerInTurf (playerid=0, turfid=49) at C:\Users\Custura\Desktop\GalacticRP v1 like H\gamemodes\galacticrp.pwn:4418
[11:06:19] [debug] #1 00318768 in public cmd_attack (playerid=0, params[]=@05078224 "") at C:\Users\Custura\Desktop\GalacticRP v1 like H\gamemodes\galacticrp.pwn:50014
[11:06:19] [debug] #2 native CallLocalFunction () from samp-server.exe
[11:06:19] [debug] #3 0001f51c in public OnPlayerCommandText (playerid=0, cmdtext[]=@05078204 "/attack") at C:\Users\Custura\Desktop\GalacticRP v1 like H\pawno\include\zcmd.inc:87
 

Pastebin:

https://pastebin.com/2PYGvQTu

Link to comment
Share on other sites

  • 0
1 oră în urmă, Banditul a spus:

Dute unde ai definit new TurfInfo si ai acolo intr-o paranteza patrata 48(posibil) si punei 50 sau mai mare(depinde cate turfuri ai in baza de daye)

Am 25 de turfuri in baza de date, doar ca e posibil sa fie problema ca nu imi citeste turfurile din baza de date

Link to comment
Share on other sites

  • 0
public LoadTurfs()
{
	new index = 0,Cache:result,rows;
	result = mysql_query(SQL,"SELECT * FROM `turfs` ORDER BY `turfs`.`ID` ASC");
	rows = cache_get_row_count(SQL);
	if(rows > 0)
	{
		for(new row; row < rows; row++)
		{
			index++;
			new i = index;
			TurfInfo[i][zID] = cache_get_field_content_int(row, "ID", SQL);
			TurfInfo[i][zOwned] = cache_get_field_content_int(row, "Owned", SQL);
			TurfInfo[i][zTime] = cache_get_field_content_int(row, "Time", SQL);
			TurfInfo[i][zMinX] = cache_get_field_content_float(row, "MinX", SQL);
			TurfInfo[i][zMinY] = cache_get_field_content_float(row, "MinY", SQL);
			TurfInfo[i][zMaxX] = cache_get_field_content_float(row, "MaxX", SQL);
			TurfInfo[i][zMaxY] = cache_get_field_content_float(row, "MaxY", SQL);
		}
	}
	cache_delete(result, SQL);
	printf("Turf: %d", index);
	return 1;
}

Eu am asta, si se incarca din baza de date

Link to comment
Share on other sites

  • 0
Acum 42 minute, Banditul a spus:

public LoadTurfs()
{
	new index = 0,Cache:result,rows;
	result = mysql_query(SQL,"SELECT * FROM `turfs` ORDER BY `turfs`.`ID` ASC");
	rows = cache_get_row_count(SQL);
	if(rows > 0)
	{
		for(new row; row < rows; row++)
		{
			index++;
			new i = index;
			TurfInfo[i][zID] = cache_get_field_content_int(row, "ID", SQL);
			TurfInfo[i][zOwned] = cache_get_field_content_int(row, "Owned", SQL);
			TurfInfo[i][zTime] = cache_get_field_content_int(row, "Time", SQL);
			TurfInfo[i][zMinX] = cache_get_field_content_float(row, "MinX", SQL);
			TurfInfo[i][zMinY] = cache_get_field_content_float(row, "MinY", SQL);
			TurfInfo[i][zMaxX] = cache_get_field_content_float(row, "MaxX", SQL);
			TurfInfo[i][zMaxY] = cache_get_field_content_float(row, "MaxY", SQL);
		}
	}
	cache_delete(result, SQL);
	printf("Turf: %d", index);
	return 1;
}

Eu am asta, si se incarca din baza de date

[11:05:33]  
[11:05:33]  
[11:05:33]  
[11:05:33]  ======================================= 
[11:05:33]  |                                     | 
[11:05:33]  |        YSI version 3.09.0684        | 
[11:05:33]  |        By Alex "Y_Less" Cole        | 
[11:05:33]  |                                     | 
[11:05:33]  ======================================= 
[11:05:33]  
[11:05:33] [MySQL Turfs]: 0

[14:29:17] [debug]  Accessing element at index 49 past array upper bound 48
[14:29:17] [debug] AMX backtrace:
[14:29:17] [debug] #0 00067dc8 in public IsPlayerInTurf (playerid=0, turfid=49) at C:\Users\Custura\Desktop\GalacticRP v1 like H\gamemodes\galacticrp turf edit buguit.pwn:4418
[14:29:17] [debug] #1 003188f0 in public cmd_attack (playerid=0, params[]=@050782b4 "") at C:\Users\Custura\Desktop\GalacticRP v1 like H\gamemodes\galacticrp turf edit buguit.pwn:50014
[14:29:17] [debug] #2 native CallLocalFunction () from samp-server.exe
[14:29:17] [debug] #3 0001f51c in public OnPlayerCommandText (playerid=0, cmdtext[]=@05078294 "/attack") at C:\Users\Custura\Desktop\GalacticRP v1 like H\pawno\include\zcmd.inc:87
 

Link to comment
Share on other sites

  • 0
La 09.04.2017 la 14:29, custura a spus:

[11:05:33]  
[11:05:33]  
[11:05:33]  
[11:05:33]  ======================================= 
[11:05:33]  |                                     | 
[11:05:33]  |        YSI version 3.09.0684        | 
[11:05:33]  |        By Alex "Y_Less" Cole        | 
[11:05:33]  |                                     | 
[11:05:33]  ======================================= 
[11:05:33]  
[11:05:33] [MySQL Turfs]: 0

[14:29:17] [debug]  Accessing element at index 49 past array upper bound 48
[14:29:17] [debug] AMX backtrace:
[14:29:17] [debug] #0 00067dc8 in public IsPlayerInTurf (playerid=0, turfid=49) at C:\Users\Custura\Desktop\GalacticRP v1 like H\gamemodes\galacticrp turf edit buguit.pwn:4418
[14:29:17] [debug] #1 003188f0 in public cmd_attack (playerid=0, params[]=@050782b4 "") at C:\Users\Custura\Desktop\GalacticRP v1 like H\gamemodes\galacticrp turf edit buguit.pwn:50014
[14:29:17] [debug] #2 native CallLocalFunction () from samp-server.exe
[14:29:17] [debug] #3 0001f51c in public OnPlayerCommandText (playerid=0, cmdtext[]=@05078294 "/attack") at C:\Users\Custura\Desktop\GalacticRP v1 like H\pawno\include\zcmd.inc:87
 

Ai un vector cu 48 de pozitii si tu accesezi pozitia 49, posibil ai mai adaugat turfuri dar nu ai marit vectorul

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.