Raised This Month: $51 Target: $400
 12% 

[ZP][Help] Problem fvault


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mathialv
Junior Member
Join Date: Jul 2012
Old 01-29-2020 , 09:46   [ZP][Help] Problem fvault
Reply With Quote #1

Hello, I have a problem to save the fvault, the problem is that when you change the map when you are a spectator, the data is lost and when you are connected playing no,
I tried to search on many sides and I can't find the solution, so post, here is the save code,

Data Saved Fvault
PHP Code:
/*Name, Lvl, Cost, Ammopacks, Reset, Class Z, Class H, Points H, Points Z, Speed H, Dmg H, HP H, Gravity H, Vest H, //possible saving error and severity error, Speed Z, HP Z, Gravity Z, Dmg Z, ID*/
"Name" "1 30 0 1 0 0 500 500 5 7 6 250 10 1 3 5 4 2" 1580225572

code
public Load(id)
{
new 
data[64];
if(
fvault_get_data(g_vault_nameg_nick[id], datasizeof(data) - 1) )
{
new 
iDatos[18][12]
parse(dataiDatos[0], 11iDatos[1], 11iDatos[2], 11iDatos[3], 11iDatos[4], 11iDatos[5], 11,
iDatos[6], 11iDatos[7], 11iDatos[8], 11iDatos[9], 11iDatos[10], 11iDatos[11], 11iDatos[12], 11
iDatos[13], 11iDatos[14], 11iDatos[15], 11iDatos[16], 11iDatos[17], 11)

Lvl[id] = str_to_num(iDatos[0])
g_costo[id] = str_to_num(iDatos[1])
g_ammopacks[id] = str_to_num(iDatos[2])
g_reset[id] = str_to_num(iDatos[3])
g_zombieclassnext[id] = str_to_num(iDatos[4])
g_humanclassnext[id] = str_to_num(iDatos[5])
g_puntos[id][0] = str_to_num(iDatos[6])
g_puntos[id][1] = str_to_num(iDatos[7])

g_habh[id][0] = str_to_num(iDatos[8])
g_habh[id][1] = str_to_num(iDatos[9])
g_habh[id][2] = str_to_num(iDatos[10])
g_habh[id][3] = str_to_num(iDatos[11])
g_habh[id][4] = str_to_num(iDatos[12])
g_habh[id][5] = str_to_num(iDatos[13])

g_habz[id][0] = str_to_num(iDatos[14])
g_habz[id][1] = str_to_num(iDatos[15])
g_habz[id][2] = str_to_num(iDatos[16])
g_habz[id][3] = str_to_num(iDatos[17])
}
}

public 
Save(id)
{
new 
data[64];
formatex(datacharsmax(data), "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d"Lvl[id], g_costo[id], g_ammopacks[id], g_reset[id], g_zombieclassnext[id], g_humanclassnext[id],
g_puntos[id][0], g_puntos[id][1], g_habh[id][0], g_habh[id][1], g_habh[id][2], g_habh[id][3], g_habh[id][4], g_habh[id][5],
g_habz[id][0], g_habz[id][1], g_habz[id][2], g_habz[id][3])
fvault_set_data(g_vault_nameg_nick[id], data);


Last edited by mathialv; 01-29-2020 at 09:47.
mathialv is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 01-29-2020 , 11:27   Re: [ZP][Help] Problem fvault
Reply With Quote #2

if the data is not being saved due to you being spectator, it is definitely not in this chunk of code.
__________________
retired chump

Last edited by DjSoftero; 01-29-2020 at 11:27.
DjSoftero is offline
mathialv
Junior Member
Join Date: Jul 2012
Old 01-29-2020 , 11:35   Re: [ZP][Help] Problem fvault
Reply With Quote #3

hmmmm, Do you have any idea how to solve the problem? I just need to fix that detail and it's breaking my head ... D:
mathialv is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 01-29-2020 , 13:56   Re: [ZP][Help] Problem fvault
Reply With Quote #4

post the parts of the code which trigger the Save() function.
__________________
retired chump
DjSoftero is offline
mathialv
Junior Member
Join Date: Jul 2012
Old 01-29-2020 , 20:42   Re: [ZP][Help] Problem fvault
Reply With Quote #5

Quote:
Originally Posted by DjSoftero View Post
post the parts of the code which trigger the Save() function.
PHP Code:
public logevent_round_end()
{
// Prevent this from getting called twice when restarting (bugfix)
static Float:lastendtime
if (get_gametime() - lastendtime 0.5) return;
lastendtime get_gametime()

// Temporarily save player stats?
static idteam
for (id 1id <= g_maxplayersid++)
{

// Not connected
if (!is_user_connected(id))
continue;

team fm_get_user_team(id)

// Not playing
if (team == CS_TEAM_SPECTATOR || team == CS_TEAM_UNASSIGNED)
continue;

Save(id)
}

public 
client_disconnect(id)
{
if (
g_status[id] == LOGUEADOSave(id)
Bla bla bla...

//
public fw_svshutdown()
{
for (new 
id 1id <= get_maxplayers(); id++)
{
if (
is_user_connected(id))
Save(id// public donde guardas los datos de los jugadores
}


Last edited by mathialv; 01-29-2020 at 20:43.
mathialv is offline
ZaX
Senior Member
Join Date: Jan 2015
Old 01-29-2020 , 20:52   Re: [ZP][Help] Problem fvault
Reply With Quote #6

Code:
// Not playing
if (team == CS_TEAM_SPECTATOR || team == CS_TEAM_UNASSIGNED)
continue;
this
ZaX is offline
mathialv
Junior Member
Join Date: Jul 2012
Old 01-29-2020 , 22:37   Re: [ZP][Help] Problem fvault
Reply With Quote #7

Quote:
Originally Posted by ZaX View Post
Code:
// Not playing
if (team == CS_TEAM_SPECTATOR || team == CS_TEAM_UNASSIGNED)
continue;
this
Hmm, How should I leave it?
I tried to eliminate it, but the truth is that I don't know what the problem is.
mathialv is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 01-30-2020 , 05:09   Re: [ZP][Help] Problem fvault
Reply With Quote #8

Quote:
Originally Posted by mathialv View Post
Hmm, How should I leave it?
I tried to eliminate it, but the truth is that I don't know what the problem is.
delete that code and it's fixed
__________________
retired chump
DjSoftero is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:31.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode