Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2013-09-10, 20:13


R_D_U







Wiek: 29
Na forum: 5313 dni
Posty: 78
Nick w MP: R_D_U

Piwa: 194

Respekt: 61,5

Mam taki kod http://pastebin.com/azJSJYbk
recz w tym ?e nie mog? go za choler? zamieni? na mysql ine ?eczy porobi?em ale to sprawia mi najwi?kszy k?opot.
Mo?ecie zmieni? cho? cze?? tego kodu na mysql??

Podpis
Przyjmuję zlecenia na panele graczy adminów
http://gtao.pl/oferuje-na...2710.htm#518583
Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-09-11, 09:12


PrzemQ







Wiek: 31
Na forum: 5470 dni
Posty: 1542
Nick w MP: Przem0

Piwa: 440

Respekt: 243,9
Respekt: 243,9Respekt: 243,9

[prze]

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-09-11, 14:09


Recall







Wiek: 29
Na forum: 4694 dni
Posty: 7

Piwa: 2

Respekt: 50

A mam pytanie nie dotycz?ce Twojego tematu.Czy mo?esz mi poda? jaka to jest mapa chodzi mi o nazwe ,oczywi?cie je?li mo?esz to bardzo bym prosi? o nazw? tutaj lub PW :) Pozdrawiam!

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-09-11, 14:53


Douglas00







Wiek: 30
Na forum: 4714 dni
Posty: 24

Piwa: 874

Respekt: 69,8

Ostrzeżeń: 20%
Zapoznaj si? z dokumentacj? SA:MP i MySQL, kt?ra zapewne Ci? czego? nauczy i poradzisz sobie z przerobieniem kodu.

http://wiki.sa-mp.com/wiki/MySQL

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-09-11, 20:36


R_D_U







Wiek: 29
Na forum: 5313 dni
Posty: 78
Nick w MP: R_D_U

Piwa: 194

Respekt: 61,5

Dzi?kuj? za przeniesienie, Recall, mapka to http://gtao.pl/gamemod-dm...d-0-vt78635.htm
A co do Douglas00, to wiem ale tu jest strasznie pogmatwany kod, prosi? bym tylko o zmienienie fragmentu ?ebym ogarn?? :D

Podpis
Przyjmuję zlecenia na panele graczy adminów
http://gtao.pl/oferuje-na...2710.htm#518583
Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-09-13, 15:01


didi050799







Wiek: 31
Na forum: 4649 dni
Posty: 1
Nick w MP: didi0507



Respekt: 40

Ostrzeżeń: 20%
(mrdrifter kaza? wstawi?)

Kod:


new bufferStr[350]; //global for query (used in mysql set, mysql get)
stock AddPointOsiagniecie(playerid, osiagniecie)
{
if(!Zalogowany[playerid]) return;
switch(osiagniecie)
{
case 0,2..4,6,7,10:{
new stroo[256];
stroo = mysql_get(playerid, "osiagniecia1", "p_Players");
new osiag3[11];
sscanf(stroo, "p<,>ddddddddddd", osiag3[0], osiag3[1], osiag3[2], osiag3[3], osiag3[4], osiag3[5], osiag3[6], osiag3[7], osiag3[8], osiag3[9], osiag3[10]);

if(osiag3[osiagniecie] == 1) return;
osiag3[osiagniecie] = 1;
format(stroo, sizeof(stroo), "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", osiag3[0], osiag3[1], osiag3[2], osiag3[3], osiag3[4], osiag3[5], osiag3[6], osiag3[7], osiag3[8], osiag3[9], osiag3[10]);
mysql_set(playerid, "osiagniecia1", stroo, "p_Players");
ShowNewOsiagniecie(playerid, osiagniecie);
}
case 1:{
new stroo[256];
stroo = mysql_get(playerid, "osiagniecia1", "p_Players");
new osiag3[11];
sscanf(stroo, "p<,>ddddddddddd", osiag3[0], osiag3[1], osiag3[2], osiag3[3], osiag3[4], osiag3[5], osiag3[6], osiag3[7], osiag3[8], osiag3[9], osiag3[10]);

if(osiag3[osiagniecie] == 7) return;
osiag3[osiagniecie]++;
format(stroo, sizeof(stroo), "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", osiag3[0], osiag3[1], osiag3[2], osiag3[3], osiag3[4], osiag3[5], osiag3[6], osiag3[7], osiag3[8], osiag3[9], osiag3[10]);
mysql_set(playerid, "osiagniecia1", stroo, "p_Players");
if(osiag3[osiagniecie] == 7)
ShowNewOsiagniecie(playerid, osiagniecie);
else
ShowStatusOsiagniecia(playerid, osiagniecie, osiag3[osiagniecie]);
}
case 5:{
new stroo[256];
stroo = mysql_get(playerid, "osiagniecia1", "p_Players");
new osiag3[11];
sscanf(stroo, "p<,>ddddddddddd", osiag3[0], osiag3[1], osiag3[2], osiag3[3], osiag3[4], osiag3[5], osiag3[6], osiag3[7], osiag3[8], osiag3[9], osiag3[10]);

if(osiag3[osiagniecie] == 60) return;
osiag3[osiagniecie]++;
format(stroo, sizeof(stroo), "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", osiag3[0], osiag3[1], osiag3[2], osiag3[3], osiag3[4], osiag3[5], osiag3[6], osiag3[7], osiag3[8], osiag3[9], osiag3[10]);
mysql_set(playerid, "osiagniecia1", stroo, "p_Players");
if(osiag3[osiagniecie] == 60)
ShowNewOsiagniecie(playerid, osiagniecie);
else
ShowStatusOsiagniecia(playerid, osiagniecie, osiag3[osiagniecie]);
}
case 8,9:{
new stroo[256];
stroo = mysql_get(playerid, "osiagniecia1", "p_Players");
new osiag3[11];
sscanf(stroo, "p<,>ddddddddddd", osiag3[0], osiag3[1], osiag3[2], osiag3[3], osiag3[4], osiag3[5], osiag3[6], osiag3[7], osiag3[8], osiag3[9], osiag3[10]);

if(osiag3[osiagniecie] == 100) return;
osiag3[osiagniecie]++;
format(stroo, sizeof(stroo), "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", osiag3[0], osiag3[1], osiag3[2], osiag3[3], osiag3[4], osiag3[5], osiag3[6], osiag3[7], osiag3[8], osiag3[9], osiag3[10]);
mysql_set(playerid, "osiagniecia1", stroo, "p_Players");
if(osiag3[osiagniecie] == 100)
ShowNewOsiagniecie(playerid, osiagniecie);
else
ShowStatusOsiagniecia(playerid, osiagniecie, osiag3[osiagniecie]);
}
case 11:{
new stroo[256];
stroo = mysql_get(playerid, "osiagniecia2", "p_Players");
new osiag3[8];
sscanf(stroo, "p<,>dddddddd", osiag3[0], osiag3[1], osiag3[2], osiag3[3], osiag3[4], osiag3[5], osiag3[6], osiag3[7]);

if(osiag3[0] == 1) return;
osiag3[0] = 1;
format(stroo, sizeof(stroo), "%d,%d,%d,%d,%d,%d,%d,%d", osiag3[0], osiag3[1], osiag3[2], osiag3[3], osiag3[4], osiag3[5], osiag3[6], osiag3[7]);
mysql_set(playerid, "osiagniecia2", stroo, "p_Players");
ShowNewOsiagniecie(playerid, osiagniecie);
}
case 12:{
new stroo[256];
stroo = mysql_get(playerid, "osiagniecia2", "p_Players");
new osiag3[8];
sscanf(stroo, "p<,>dddddddd", osiag3[0], osiag3[1], osiag3[2], osiag3[3], osiag3[4], osiag3[5], osiag3[6], osiag3[7]);

if(osiag3[1] == 1) return;
osiag3[1] = 1;
format(stroo, sizeof(stroo), "%d,%d,%d,%d,%d,%d,%d,%d", osiag3[0], osiag3[1], osiag3[2], osiag3[3], osiag3[4], osiag3[5], osiag3[6], osiag3[7]);
mysql_set(playerid, "osiagniecia2", stroo, "p_Players");
ShowNewOsiagniecie(playerid, osiagniecie);
}
case 13:{
new stroo[256];
stroo = mysql_get(playerid, "osiagniecia2", "p_Players");
new osiag3[8];
sscanf(stroo, "p<,>dddddddd", osiag3[0], osiag3[1], osiag3[2], osiag3[3], osiag3[4], osiag3[5], osiag3[6], osiag3[7]);

if(osiag3[2] == 10) return;
osiag3[2]++;
format(stroo, sizeof(stroo), "%d,%d,%d,%d,%d,%d,%d,%d", osiag3[0], osiag3[1], osiag3[2], osiag3[3], osiag3[4], osiag3[5], osiag3[6], osiag3[7]);
mysql_set(playerid, "osiagniecia2", stroo, "p_Players");
if(osiag3[2] == 10)
ShowNewOsiagniecie(playerid, osiagniecie);
else
ShowStatusOsiagniecia(playerid, osiagniecie, osiag3[2]);
}
case 14:{
new stroo[256];
stroo = mysql_get(playerid, "osiagniecia2", "p_Players");
new osiag3[8];
sscanf(stroo, "p<,>dddddddd", osiag3[0], osiag3[1], osiag3[2], osiag3[3], osiag3[4], osiag3[5], osiag3[6], osiag3[7]);

if(osiag3[3] == 1) return;
osiag3[3] = 1;
format(stroo, sizeof(stroo), "%d,%d,%d,%d,%d,%d,%d,%d", osiag3[0], osiag3[1], osiag3[2], osiag3[3], osiag3[4], osiag3[5], osiag3[6], osiag3[7]);
mysql_set(playerid, "osiagniecia2", stroo, "p_Players");
ShowNewOsiagniecie(playerid, osiagniecie);
}
case 15:{
new stroo[256];
stroo = mysql_get(playerid, "osiagniecia2", "p_Players");
new osiag3[8];
sscanf(stroo, "p<,>dddddddd", osiag3[0], osiag3[1], osiag3[2], osiag3[3], osiag3[4], osiag3[5], osiag3[6], osiag3[7]);

if(osiag3[4] == 1) return;
osiag3[4] = 1;
format(stroo, sizeof(stroo), "%d,%d,%d,%d,%d,%d,%d,%d", osiag3[0], osiag3[1], osiag3[2], osiag3[3], osiag3[4], osiag3[5], osiag3[6], osiag3[7]);
mysql_set(playerid, "osiagniecia2", stroo, "p_Players");
ShowNewOsiagniecie(playerid, osiagniecie);
}
case 16:{
new stroo[256];
stroo = mysql_get(playerid, "osiagniecia2", "p_Players");
new osiag3[8];
sscanf(stroo, "p<,>dddddddd", osiag3[0], osiag3[1], osiag3[2], osiag3[3], osiag3[4], osiag3[5], osiag3[6], osiag3[7]);

if(osiag3[5] == 100) return;
osiag3[5]++;
format(stroo, sizeof(stroo), "%d,%d,%d,%d,%d,%d,%d,%d", osiag3[0], osiag3[1], osiag3[2], osiag3[3], osiag3[4], osiag3[5], osiag3[6], osiag3[7]);
mysql_set(playerid, "osiagniecia2", stroo, "p_Players");
if(osiag3[5] == 100)
ShowNewOsiagniecie(playerid, osiagniecie);
else
ShowStatusOsiagniecia(playerid, osiagniecie, osiag3[5]);
}
case 17:{
new stroo[256];
stroo = mysql_get(playerid, "osiagniecia2", "p_Players");
new osiag3[8];
sscanf(stroo, "p<,>dddddddd", osiag3[0], osiag3[1], osiag3[2], osiag3[3], osiag3[4], osiag3[5], osiag3[6], osiag3[7]);

if(osiag3[6] == 100) return;
osiag3[6]++;
format(stroo, sizeof(stroo), "%d,%d,%d,%d,%d,%d,%d,%d", osiag3[0], osiag3[1], osiag3[2], osiag3[3], osiag3[4], osiag3[5], osiag3[6], osiag3[7]);
mysql_set(playerid, "osiagniecia2", stroo, "p_Players");
if(osiag3[6] == 100)
ShowNewOsiagniecie(playerid, osiagniecie);
else
ShowStatusOsiagniecia(playerid, osiagniecie, osiag3[6]);
}
case 18:{
new stroo[256];
stroo = mysql_get(playerid, "osiagniecia2", "p_Players");
new osiag3[8];
sscanf(stroo, "p<,>dddddddd", osiag3[0], osiag3[1], osiag3[2], osiag3[3], osiag3[4], osiag3[5], osiag3[6], osiag3[7]);

if(osiag3[7] == 10) return;
osiag3[7]++;
format(stroo, sizeof(stroo), "%d,%d,%d,%d,%d,%d,%d,%d", osiag3[0], osiag3[1], osiag3[2], osiag3[3], osiag3[4], osiag3[5], osiag3[6], osiag3[7]);
mysql_set(playerid, "osiagniecia2", stroo, "p_Players");
if(osiag3[7] == 10)
ShowNewOsiagniecie(playerid, osiagniecie);
else
ShowStatusOsiagniecia(playerid, osiagniecie, osiag3[7]);
}
}
}

stock mysql_get(playerid, field[], table[])
{
new string[255];
format(bufferStr, sizeof bufferStr, "Select %s from %s where Nick='%s' limit 1", field, table, PlayerName(playerid));
mysql_query(bufferStr);
mysql_store_result();
mysql_fetch_string(string);
mysql_free_result();

return string;
}
stock mysql_set(playerid, field[], string[], table[])
{
format(bufferStr, sizeof bufferStr, "UPDATE `%s` SET `%s` = '%s' WHERE `Nick` ='%s';",table, field, string, PlayerName(playerid));
mysql_query(bufferStr);
}


Postaw piwo autorowi tego posta
 

 
Tagi: dini :: -gt :: mysql :: jak :: zmienic
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » PAWN Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku