new line[128], f=0, idx, field[MAX_PLAYER_NAME];
CheckSQLConnection();
mysql_query("SELECT * FROM forbnames");
mysql_store_result();
while(mysql_fetch_row(line)) {
mysql_fetch_row_format(line, " ");
field = strtok(line, idx);
format(ForbidNames[f], MAX_PLAYER_NAME, field);
f++;
}
mysql_free_result();
new
data[128],
row[512],
i;
mysql_query("SELECT * FROM `forbnames`");
mysql_store_result();
while(mysql_fetch_row(row))
{
mysql_fetch_field_row(data, "Name on mysql column");
strmid(ForbidNames[f], data, 0, strlen(data), MAX_PLAYER_NAME);
i++;
}
|
Originally Posted by ǝɹoɯ‾ʎ
pawn Код:
|
while(samp_mysql_strtok(arm, "|", armas)==1 && consulta[playerid] <= 6) //From 2nd call to the end you MUST call strtok without resultline
{
while(samp_mysql_strtok(arm, "|", "")==1 && consulta[playerid] <= 6) //From 2nd call to the end you MUST call strtok without resultline
{
consulta[playerid]++;
if(consulta[playerid] == 1)
{
arma2[playerid] = strval(arm);
if(arma2[playerid] == strval(""))
arma2[playerid] = 0;
printf("arma1: %s",arm); // palos
}
if(consulta[playerid] == 2)
{
arma3[playerid] = strval(arm);
if(arma3[playerid] == strval(""))
arma3[playerid] = 0;
printf("arma2: %s",arm); // pistolitas
}
if(consulta[playerid] == 3)
{
arma4[playerid] = strval(arm);
if(arma4[playerid] == strval(""))
arma4[playerid] = 0;
printf("arma3: %s",arm); //m4
}
if(consulta[playerid] == 4)
{
arma5[playerid] = strval(arm);
if(arma5[playerid] == strval(""))
arma5[playerid] = 0;
printf("arma4: %s",arm); // escopetas
}
if(consulta[playerid] == 5)
{
arma6[playerid] = strval(arm);
if(arma6[playerid] == strval(""))
arma6[playerid] = 0;
printf("arma5: %s",arm); // mp5
}
}
}
|
Originally Posted by elvago
nothing can helpme?
![]() |
new
data[128],
row[512],
i;
mysql_query("SELECT * FROM `DATABASE_NAME`");
mysql_store_result();
while(mysql_fetch_row(row))
{
mysql_fetch_field_row(data, "Name on mysql column");
arma2[playerid] = strval(arm);
if(arma2[playerid] == strval(""))
arma2[playerid] = 0;
printf("arma1: %s",arm); // palos
mysql_fetch_field_row(data, "Name on mysql column");
arma3[playerid] = strval(arm);
if(arma3[playerid] == strval(""))
arma3[playerid] = 0;
printf("arma2: %s",arm); // pistolitas
mysql_fetch_field_row(data, "Name on mysql column");
arma4[playerid] = strval(arm);
if(arma4[playerid] == strval(""))
arma4[playerid] = 0;
printf("arma3: %s",arm); //m4
mysql_fetch_field_row(data, "Name on mysql column");
arma5[playerid] = strval(arm);
if(arma5[playerid] == strval(""))
arma5[playerid] = 0;
printf("arma4: %s",arm); // escopetas
mysql_fetch_field_row(data, "Name on mysql column");
arma6[playerid] = strval(arm);
if(arma6[playerid] == strval(""))
arma6[playerid] = 0;
printf("arma5: %s",arm); // mp5
i++;
}
you can fix this?
mysql_connect("127.0.0.1","root","samp","root");
printf("Connecting done");
mysql_query("SELECT money FROM gebruikers WHERE naam = 'Stijn'");
mysql_store_result();
new row[1];
new i;
while(mysql_fetch_row(row))
{
printf("%d", row[i]);
i++;
}
format(sql, sizeof(sql), "SELECT * FROM jobright WHERE userID = '%d' AND jobID = '%d'", GlobalAccountData[playerid][AccountID], JOB_MEDIC);
mysql_query(sql);
mysql_store_result();
if(mysql_num_rows() == 1)
{
//do somethink
}
mysql_free_result();
-------------------------- Exception At Address: 0x00B56ED0 Registers: EAX: 0xDDDDDDDD EBX: 0x00000001 ECX: 0xDDDDDDDD EDX: 0x00DEFC15 ESI: 0x01215968 EDI: 0x0013F55C EBP: 0x0013F55C ESP: 0x0013F520 EFLAGS: 0x00010212 Stack:
[root@box source_files]# make gcc -c -O3 -w -DLINUX -I../SDK/amx/ ../SDK/amx/*.c g++ -c -O3 -w -DLINUX -I../SDK/amx/ ../SDK/*.cpp g++ -c -O3 -w -DLINUX -I../SDK/amx/ *.cpp In file included from main.cpp:3: main.h:18:26: error: mysql/mysql.h: No such file or directory source/mysqlhandler.h:16: error: 'my_ulonglong' does not name a type main.h:38: error: 'MYSQL' does not name a type main.h:39: error: 'MYSQL_ROW' does not name a type main.h:40: error: ISO C++ forbids declaration of 'MYSQL_RES' with no type main.h:40: error: expected ';' before '*' token main.h:41: error: ISO C++ forbids declaration of 'MYSQL_FIELD' with no type main.h:41: error: expected ';' before '*' token make: *** [all] Error 1

|
Originally Posted by michael2572
Could someone who knows please explain what this error means?
Run time error 19: "File or function is not found" I'm 100% positive I set up the plugin correctly. When I don't include the natives, the plugin loads successfully: /************************************************/ /* SAMP-MySQL v0.13 Plugin loaded successfully ! */ /************************************************/ Yet when I DO include the natives, I get the runtime error. Which is a piece of crap, by the way, cause the damn thing is very vague and doesn't even give a line number. Thanks in advance. |
|
Originally Posted by simstosh
I'm trying to compile the source but MAKE shows these errors... :/
Код:
[root@box source_files]# make gcc -c -O3 -w -DLINUX -I../SDK/amx/ ../SDK/amx/*.c g++ -c -O3 -w -DLINUX -I../SDK/amx/ ../SDK/*.cpp g++ -c -O3 -w -DLINUX -I../SDK/amx/ *.cpp In file included from main.cpp:3: main.h:18:26: error: mysql/mysql.h: No such file or directory source/mysqlhandler.h:16: error: 'my_ulonglong' does not name a type main.h:38: error: 'MYSQL' does not name a type main.h:39: error: 'MYSQL_ROW' does not name a type main.h:40: error: ISO C++ forbids declaration of 'MYSQL_RES' with no type main.h:40: error: expected ';' before '*' token main.h:41: error: ISO C++ forbids declaration of 'MYSQL_FIELD' with no type main.h:41: error: expected ';' before '*' token make: *** [all] Error 1 |
