[Ajuda] Nгo ta salvando mysql
#1

Gente to mt tempo sem mexer com SAMP, peguei meu GM, ta dando um monte de problema que antes de eu parar nгo dava (PS: FUI EU Q FIZ ESSE GM )

MYSQL nгo ta carregando... pq sr!?

stock que salva as variaveis do player (chamad ongamemodexit e onplayerdisconnect)
Код:
stock OnPlayerSave(playerid) {
	new query[1024], ip[25];
	GetPlayerIp(playerid, ip, sizeof(ip));
	money[playerid] = GetPlayerMoneyEx(playerid);

	format(query, sizeof(query), "UPDATE accounts SET Username = '%s', IP = '%s', scorelevel = %d, maconha = %d, sementes = %d, BPsize = %d, lastlogin = %d, wanted = %d, moneybag = %d, COPskills = %d, CRIMINALskills = %d, PARAMEDICskills = %d, admin = %d, money = %d, bank = %d, kills = %d, deaths = %d, ",
		GetName(playerid), ip, scorelevel[playerid], maconha[playerid], sementes[playerid], BPsize[playerid], lastlogin[playerid], wanted[playerid], moneybag[playerid], COPskills[playerid], CRIMINALskills[playerid], PARAMEDICskills[playerid], admin[playerid], money[playerid], bank[playerid], kills[playerid], deaths[playerid]);
		
	format(query, sizeof(query), "%seagleSPAWN = %d, shotgunSPAWN = %d, spazSPAWN = %d, mp5SPAWN = %d, akSPAWN = %d, m4SPAWN = %d, rifleSPAWN = %d, sniperSPAWN = %d, meleeSPAWN[ = %d, ",
		GetName(playerid), EagleSPAWN[playerid], shotgunSPAWN[playerid], spazSPAWN[playerid], mp5SPAWN[playerid], akSPAWN[playerid], m4SPAWN[playerid], rifleSPAWN[playerid], sniperSPAWN[playerid], meleeSPAWN[playerid]);
		
	format(query, sizeof(query), "%sDP = %d, VIP = %d, fmembro = %d, fcargo = %d, preso = %d, presotime = %d, startVIPdia = %d, startVIPmes = %d, startVIPano = %d, carid = %d, carpos0 = %f, carpos1 = %f, carpos2 = %f, carpos3 = %f, spawnpoint = %d, housekey = %d, idiom = %d, tutorial = %d, banned = %d, leftBANdia = %d, leftBANmes = %d, leftBANano = %d WHERE Username = '%s'",
		query, DP[playerid], VIP[playerid], fmembro[playerid], fcargo[playerid], preso[playerid], presotime[playerid], startVIPdia[playerid], startVIPmes[playerid], startVIPano[playerid], carid[playerid], carpos[playerid][0], carpos[playerid][1], carpos[playerid][2], carpos[playerid][3], spawnpoint[playerid], housekey[playerid], idiom[playerid], tutorial[playerid], banned[playerid], leftBANdia[playerid], leftBANmes[playerid], leftBANano[playerid] , GetName(playerid) );
	mysql_pquery(ConnectMYSQL, query);
}
Reply
#2

Nгo estб abrindo o servidor, ou nгo estб salvando?

#EDIT
Tenta da seguinte forma:
PHP код:
stock OnPlayerSave(playerid) {
    new 
query[1024], ip[25];
    
GetPlayerIp(playeridipsizeof(ip));
    
money[playerid] = GetPlayerMoneyEx(playerid);
    
format(querysizeof(query), "UPDATE accounts SET Username = '%s', IP = '%s', scorelevel = %d, maconha = %d, sementes = %d, BPsize = %d, lastlogin = %d, wanted = %d, moneybag = %d, COPskills = %d, CRIMINALskills = %d, PARAMEDICskills = %d, admin = %d, money = %d, bank = %d, kills = %d, deaths = %d, ",
        
GetName(playerid), ipscorelevel[playerid], maconha[playerid], sementes[playerid], BPsize[playerid], lastlogin[playerid], wanted[playerid], moneybag[playerid], COPskills[playerid], CRIMINALskills[playerid], PARAMEDICskills[playerid], admin[playerid], money[playerid], bank[playerid], kills[playerid], deaths[playerid]);
        
    
format(querysizeof(query), "%seagleSPAWN = %d, shotgunSPAWN = %d, spazSPAWN = %d, mp5SPAWN = %d, akSPAWN = %d, m4SPAWN = %d, rifleSPAWN = %d, sniperSPAWN = %d, meleeSPAWN[ = %d, ",
        
queryEagleSPAWN[playerid], shotgunSPAWN[playerid], spazSPAWN[playerid], mp5SPAWN[playerid], akSPAWN[playerid], m4SPAWN[playerid], rifleSPAWN[playerid], sniperSPAWN[playerid], meleeSPAWN[playerid]);
        
    
format(querysizeof(query), "%sDP = %d, VIP = %d, fmembro = %d, fcargo = %d, preso = %d, presotime = %d, startVIPdia = %d, startVIPmes = %d, startVIPano = %d, carid = %d, carpos0 = %f, carpos1 = %f, carpos2 = %f, carpos3 = %f, spawnpoint = %d, housekey = %d, idiom = %d, tutorial = %d, banned = %d, leftBANdia = %d, leftBANmes = %d, leftBANano = %d WHERE Username = '%s'",
        
queryDP[playerid], VIP[playerid], fmembro[playerid], fcargo[playerid], preso[playerid], presotime[playerid], startVIPdia[playerid], startVIPmes[playerid], startVIPano[playerid], carid[playerid], carpos[playerid][0], carpos[playerid][1], carpos[playerid][2], carpos[playerid][3], spawnpoint[playerid], housekey[playerid], idiom[playerid], tutorial[playerid], banned[playerid], leftBANdia[playerid], leftBANmes[playerid], leftBANano[playerid] , GetName(playerid) );
    
mysql_pquery(ConnectMYSQLquery);

Reply
#3

Quote:
Originally Posted by HaRdiiZin
Посмотреть сообщение
Nгo estб abrindo o servidor, ou nгo estб salvando?

#EDIT
Tenta da seguinte forma:
PHP код:
stock OnPlayerSave(playerid) {
    new 
query[1024], ip[25];
    
GetPlayerIp(playeridipsizeof(ip));
    
money[playerid] = GetPlayerMoneyEx(playerid);
    
format(querysizeof(query), "UPDATE accounts SET Username = '%s', IP = '%s', scorelevel = %d, maconha = %d, sementes = %d, BPsize = %d, lastlogin = %d, wanted = %d, moneybag = %d, COPskills = %d, CRIMINALskills = %d, PARAMEDICskills = %d, admin = %d, money = %d, bank = %d, kills = %d, deaths = %d, ",
        
GetName(playerid), ipscorelevel[playerid], maconha[playerid], sementes[playerid], BPsize[playerid], lastlogin[playerid], wanted[playerid], moneybag[playerid], COPskills[playerid], CRIMINALskills[playerid], PARAMEDICskills[playerid], admin[playerid], money[playerid], bank[playerid], kills[playerid], deaths[playerid]);
        
    
format(querysizeof(query), "%seagleSPAWN = %d, shotgunSPAWN = %d, spazSPAWN = %d, mp5SPAWN = %d, akSPAWN = %d, m4SPAWN = %d, rifleSPAWN = %d, sniperSPAWN = %d, meleeSPAWN[ = %d, ",
        
queryEagleSPAWN[playerid], shotgunSPAWN[playerid], spazSPAWN[playerid], mp5SPAWN[playerid], akSPAWN[playerid], m4SPAWN[playerid], rifleSPAWN[playerid], sniperSPAWN[playerid], meleeSPAWN[playerid]);
        
    
format(querysizeof(query), "%sDP = %d, VIP = %d, fmembro = %d, fcargo = %d, preso = %d, presotime = %d, startVIPdia = %d, startVIPmes = %d, startVIPano = %d, carid = %d, carpos0 = %f, carpos1 = %f, carpos2 = %f, carpos3 = %f, spawnpoint = %d, housekey = %d, idiom = %d, tutorial = %d, banned = %d, leftBANdia = %d, leftBANmes = %d, leftBANano = %d WHERE Username = '%s'",
        
queryDP[playerid], VIP[playerid], fmembro[playerid], fcargo[playerid], preso[playerid], presotime[playerid], startVIPdia[playerid], startVIPmes[playerid], startVIPano[playerid], carid[playerid], carpos[playerid][0], carpos[playerid][1], carpos[playerid][2], carpos[playerid][3], spawnpoint[playerid], housekey[playerid], idiom[playerid], tutorial[playerid], banned[playerid], leftBANdia[playerid], leftBANmes[playerid], leftBANano[playerid] , GetName(playerid) );
    
mysql_pquery(ConnectMYSQLquery);

Sу nгo ta funcionando mesmo, ta abrindo o SV, mas tipo ta carregando minha conta de qnd eu mexia no GM, se eu perder toda a grana nгo salva qnd eu relogo, volta a antiga, pq n ta salvando

Teu cod n funfo, o estranho й q esse cod funcionava, eu acho :S
Reply
#4

PHP код:
stock OnPlayerSave(playerid)
{
    new 
query[3][500], querytotal[1500], ip[25];
    
GetPlayerIp(playeridipsizeof(ip));
    
money[playerid] = GetPlayerMoneyEx(playerid);
    
formatquery[0], 500query[0] , "UPDATE accounts SET Username = '%s', IP = '%s', scorelevel = %d, maconha = %d, sementes = %d, BPsize = %d, lastlogin = %d, wanted = %d, moneybag = %d, COPskills = %d, CRIMINALskills = %d, PARAMEDICskills = %d, admin = %d, money = %d, bank = %d, kills = %d, deaths = %d, ",
        
GetName(playerid), ipscorelevel[playerid], maconha[playerid], sementes[playerid], BPsize[playerid], lastlogin[playerid], wanted[playerid], moneybag[playerid], COPskills[playerid], CRIMINALskills[playerid], PARAMEDICskills[playerid], admin[playerid], money[playerid], bank[playerid], kills[playerid], deaths[playerid]);
    
formatquery[1], 500query[1] , "eagleSPAWN = %d, shotgunSPAWN = %d, spazSPAWN = %d, mp5SPAWN = %d, akSPAWN = %d, m4SPAWN = %d, rifleSPAWN = %d, sniperSPAWN = %d, meleeSPAWN[ = %d, ",
        
EagleSPAWN[playerid], shotgunSPAWN[playerid], spazSPAWN[playerid], mp5SPAWN[playerid], akSPAWN[playerid], m4SPAWN[playerid], rifleSPAWN[playerid], sniperSPAWN[playerid], meleeSPAWN[playerid]);
    
formatquery[2], 500query[2] , "DP = %d, VIP = %d, fmembro = %d, fcargo = %d, preso = %d, presotime = %d, startVIPdia = %d, startVIPmes = %d, startVIPano = %d, carid = %d, carpos0 = %f, carpos1 = %f, carpos2 = %f, carpos3 = %f, spawnpoint = %d, housekey = %d, idiom = %d, tutorial = %d, banned = %d, leftBANdia = %d, leftBANmes = %d, leftBANano = %d WHERE Username = '%s'",
        
DP[playerid], VIP[playerid], fmembro[playerid], fcargo[playerid], preso[playerid], presotime[playerid], startVIPdia[playerid], startVIPmes[playerid], startVIPano[playerid], carid[playerid], carpos[playerid][0], carpos[playerid][1], carpos[playerid][2], carpos[playerid][3], spawnpoint[playerid], housekey[playerid], idiom[playerid], tutorial[playerid], banned[playerid], leftBANdia[playerid], leftBANmes[playerid], leftBANano[playerid] , GetName(playerid) );
    
formatquerytotalsizeofquerytotal), "%s%s%s"query[0], query[1], query[2]);
    
mysql_pquery(ConnectMYSQLquerytotal);

Reply
#5

Quote:
Originally Posted by [BOPE]Seu._.Madruga
Посмотреть сообщение
PHP код:
stock OnPlayerSave(playerid)
{
    new 
query[3][500], querytotal[1500], ip[25];
    
GetPlayerIp(playeridipsizeof(ip));
    
money[playerid] = GetPlayerMoneyEx(playerid);
    
formatquery[0], 500query[0] , "UPDATE accounts SET Username = '%s', IP = '%s', scorelevel = %d, maconha = %d, sementes = %d, BPsize = %d, lastlogin = %d, wanted = %d, moneybag = %d, COPskills = %d, CRIMINALskills = %d, PARAMEDICskills = %d, admin = %d, money = %d, bank = %d, kills = %d, deaths = %d, ",
        
GetName(playerid), ipscorelevel[playerid], maconha[playerid], sementes[playerid], BPsize[playerid], lastlogin[playerid], wanted[playerid], moneybag[playerid], COPskills[playerid], CRIMINALskills[playerid], PARAMEDICskills[playerid], admin[playerid], money[playerid], bank[playerid], kills[playerid], deaths[playerid]);
    
formatquery[1], 500query[1] , "eagleSPAWN = %d, shotgunSPAWN = %d, spazSPAWN = %d, mp5SPAWN = %d, akSPAWN = %d, m4SPAWN = %d, rifleSPAWN = %d, sniperSPAWN = %d, meleeSPAWN[ = %d, ",
        
EagleSPAWN[playerid], shotgunSPAWN[playerid], spazSPAWN[playerid], mp5SPAWN[playerid], akSPAWN[playerid], m4SPAWN[playerid], rifleSPAWN[playerid], sniperSPAWN[playerid], meleeSPAWN[playerid]);
    
formatquery[2], 500query[2] , "DP = %d, VIP = %d, fmembro = %d, fcargo = %d, preso = %d, presotime = %d, startVIPdia = %d, startVIPmes = %d, startVIPano = %d, carid = %d, carpos0 = %f, carpos1 = %f, carpos2 = %f, carpos3 = %f, spawnpoint = %d, housekey = %d, idiom = %d, tutorial = %d, banned = %d, leftBANdia = %d, leftBANmes = %d, leftBANano = %d WHERE Username = '%s'",
        
DP[playerid], VIP[playerid], fmembro[playerid], fcargo[playerid], preso[playerid], presotime[playerid], startVIPdia[playerid], startVIPmes[playerid], startVIPano[playerid], carid[playerid], carpos[playerid][0], carpos[playerid][1], carpos[playerid][2], carpos[playerid][3], spawnpoint[playerid], housekey[playerid], idiom[playerid], tutorial[playerid], banned[playerid], leftBANdia[playerid], leftBANmes[playerid], leftBANano[playerid] , GetName(playerid) );
    
formatquerytotalsizeofquerytotal), "%s%s%s"query[0], query[1], query[2]);
    
mysql_pquery(ConnectMYSQLquerytotal);

Pq ta dando isso agora qnd compila?
Код:
Header size:          10252 bytes
Code size:           703112 bytes
Data size:          5179940 bytes
Stack/heap size:      16384 bytes; estimated max. usage=4363 cells (17452 bytes)
Total requirements: 5909688 bytes
Reply
#6

Й Sу diminuir a quantia de celular usadas na string query
PHP код:
new query[3][300], querytotal[900], ip[25]; 
Reply
#7

Quote:
Originally Posted by maikons
Посмотреть сообщение
Pq ta dando isso agora qnd compila?
Код:
Header size:          10252 bytes
Code size:           703112 bytes
Data size:          5179940 bytes
Stack/heap size:      16384 bytes; estimated max. usage=4363 cells (17452 bytes)
Total requirements: 5909688 bytes
#pragma dynamic 20000
Reply
#8

Quote:
Originally Posted by ipsLeon
Посмотреть сообщение
#pragma dynamic 20000
Queria que me explica-se oq й isso, atй pq meu maior objetivo й aprender

Quote:
Originally Posted by [BOPE]Seu._.Madruga
Посмотреть сообщение
Й Sу diminuir a quantia de celular usadas na string query
PHP код:
new query[3][300], querytotal[900], ip[25]; 
Continua sem funcionar, o que vocкs tгo achando que й ?
Reply
#9

Quote:
Originally Posted by maikons
Посмотреть сообщение
Queria que me explica-se oq й isso, atй pq meu maior objetivo й aprender



Continua sem funcionar, o que vocкs tгo achando que й ?
Com o pragma dynamic 20000 vocк aloca 20000 bytes reservados pra sua memуria local (memуria heap), sendo assim, seu gamemode estб usando aproximadamente 18000 bytes, com 20000 alocados dб e sobra um pouco
Reply
#10

Continua sem salvar gente.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)