←  Multilingual

AMXX.pl: Support AMX Mod X i SourceMod

»

Saving Problem.

  • +
  • -
supertaranta - zdjęcie supertaranta 06.05.2009

Ok, so like the whole nvault, it supposidly saves but everytime i change the map its back to 0? how can i save it so its a stable save exp no matter what to map it changes to. Thanks greatfully anyone.
Odpowiedz

  • +
  • -
Miczu - zdjęcie Miczu 06.05.2009

supertaranta, have you after disconnect and connect while the same map lvl from time when you disconnected?
Odpowiedz

  • +
  • -
supertaranta - zdjęcie supertaranta 07.05.2009

Um i dont quite understand what you wrote. Sorry. Um what happens is, Like when i join the game, and i kill someone, then lets say i leave or whatever and come back, the experiance is not saved on that map. But when the map changes everything also is gone disappears. and its level one again. and if i go back to the other map then its still level one. How can i do it so it saves and has the level as saved. for example. if i play de_dust and i get level 10, and it saves, like changes map, then i go to de_rats and it loads that level ten.

edit: in a easy way of saying. If i leave and come back it doesnt save. =/
Odpowiedz

  • +
  • -
Miczu - zdjęcie Miczu 07.05.2009

Is that your version od mod? (edited saving to nvault version?)
Odpowiedz

  • +
  • -
supertaranta - zdjęcie supertaranta 07.05.2009

Yes it is. Its the one where we added the saving for each level seperatly. Is there a way for it to actually stay saved?

Here is code if u need it.

public savexpcom(id)
{
	if(get_cvar_num("SaveXP") == 1) 
	{
    		SubtractStats(id,player_b_extrastats[id])
		SubtractRing(id)
		SaveXP(id)
		BoostStats(id,player_b_extrastats[id])
		BoostRing(id)
	}
}

public SaveXP(id){
	new playerid[35];     
	get_user_authid(id,playerid,34); 
	
	replace_all(playerid, 34, " ", "")
	 
	new vaultkey[64],vaultdata[256]
	format(vaultkey,63,"%s-Dbmod",playerid)
	format(vaultkey,63,"%s-%d-Dbmod",playerid,player_class[id]) 
	format(vaultdata,255,"%i#%i#%i#%i#%i#%i#%i#%i",player_class[id],player_<img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />[id],player_lvl[id],player_intelligence[id],player_strength[id],player_point[id],player_agility[id],player_dextery[id])
	nvault_set(g_vault,vaultkey,vaultdata)
	return PLUGIN_HANDLED
} 
    
public LoadXP(id){
	new playerid[35];     
    	get_user_authid(id,playerid,34);

    	new vaultkey[64],vaultdata[256]
    	format(vaultkey,63,"%s-%d-Dbmod",playerid,player_class[id])
	nvault_get(g_vault,vaultkey,vaultdata,255)
	 
	replace_all(vaultdata, 255, "#", " ")
	
	new playerclass [33],playerxp[33],playerlvl[33],playerintelligence[33],playerstrength[33],playerpoint[33],playeragility[33],playerdextery[33]
	 
	parse(vaultdata, playerclass, 32, playerxp, 32, playerlvl, 32, playerintelligence, 32, playerstrength, 32, playerpoint, 32, playeragility, 32, playerdextery, 32)
	 
	player_class[id] = str_to_num(playerclass)
	player_<img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />[id] = str_to_num(playerxp)
	player_lvl[id] = str_to_num(playerlvl)
	player_intelligence[id] = str_to_num(playerintelligence)
	player_strength[id] = str_to_num(playerstrength)
	player_point[id] = str_to_num(playerpoint)
	player_agility[id] = str_to_num(playeragility)
	player_dextery[id] = str_to_num(playerdextery)
	BoostRing(id)
	BoostStats(id,player_b_extrastats[id])
	
	player_damreduction[id] = (47.3057*(1.0-floatpower( 2.7182, -0.06798*float(player_agility[id])))/100)
	
	give_knife(id)
	
	return PLUGIN_HANDLED
} 
Odpowiedz

  • +
  • -
Miczu - zdjęcie Miczu 07.05.2009

format(vaultkey,63,"%s-%d-Dbmod",playerid,player_class[id])

format(vaultkey,63,"%s-Dbmod",playerid)

It's soo bad... no wonder it isn't working...
Odpowiedz

  • +
  • -
supertaranta - zdjęcie supertaranta 07.05.2009

lol. im sorry. so i just add those in and it should work?

edit: wait so what u have up there is the problem? If so what can i change to fix it up.
Odpowiedz

  • +
  • -
Miczu - zdjęcie Miczu 07.05.2009

You have to write the same key for save and load. I would for start copy vaultkey formating from load to save.
Odpowiedz

  • +
  • -
supertaranta - zdjęcie supertaranta 07.05.2009

Ok so i did that. its still not saving =/.

public savexpcom(id)
{
	if(get_cvar_num("SaveXP") == 1) 
	{
    		SubtractStats(id,player_b_extrastats[id])
		SubtractRing(id)
		SaveXP(id)
		BoostStats(id,player_b_extrastats[id])
		BoostRing(id)
	}
}

public SaveXP(id){
	new playerid[35];     
    	get_user_authid(id,playerid,34);

    	new vaultkey[64],vaultdata[256]
    	format(vaultkey,63,"%s-%d-Dbmod",playerid,player_class[id])
	nvault_get(g_vault,vaultkey,vaultdata,255)
	 
	replace_all(vaultdata, 255, "#", " ")
	
	new playerclass [33],playerxp[33],playerlvl[33],playerintelligence[33],playerstrength[33],playerpoint[33],playeragility[33],playerdextery[33]
	 
	parse(vaultdata, playerclass, 32, playerxp, 32, playerlvl, 32, playerintelligence, 32, playerstrength, 32, playerpoint, 32, playeragility, 32, playerdextery, 32)

	player_class[id] = str_to_num(playerclass)
	player_<img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />[id] = str_to_num(playerxp)
	player_lvl[id] = str_to_num(playerlvl)
	player_intelligence[id] = str_to_num(playerintelligence)
	player_strength[id] = str_to_num(playerstrength)
	player_point[id] = str_to_num(playerpoint)
	player_agility[id] = str_to_num(playeragility)
	player_dextery[id] = str_to_num(playerdextery)
	BoostRing(id)
	BoostStats(id,player_b_extrastats[id])
	
	player_damreduction[id] = (47.3057*(1.0-floatpower( 2.7182, -0.06798*float(player_agility[id])))/100)
	
	give_knife(id)

	 
	nvault_set(g_vault,vaultkey,vaultdata)
	return PLUGIN_HANDLED
} 
    
public LoadXP(id){
	new playerid[35];     
    	get_user_authid(id,playerid,34);

    	new vaultkey[64],vaultdata[256]
    	format(vaultkey,63,"%s-%d-Dbmod",playerid,player_class[id])
	nvault_get(g_vault,vaultkey,vaultdata,255)
	 
	replace_all(vaultdata, 255, "#", " ")
	
	new playerclass [33],playerxp[33],playerlvl[33],playerintelligence[33],playerstrength[33],playerpoint[33],playeragility[33],playerdextery[33]
	 
	parse(vaultdata, playerclass, 32, playerxp, 32, playerlvl, 32, playerintelligence, 32, playerstrength, 32, playerpoint, 32, playeragility, 32, playerdextery, 32)
	 
	player_class[id] = str_to_num(playerclass)
	player_<img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />[id] = str_to_num(playerxp)
	player_lvl[id] = str_to_num(playerlvl)
	player_intelligence[id] = str_to_num(playerintelligence)
	player_strength[id] = str_to_num(playerstrength)
	player_point[id] = str_to_num(playerpoint)
	player_agility[id] = str_to_num(playeragility)
	player_dextery[id] = str_to_num(playerdextery)
	BoostRing(id)
	BoostStats(id,player_b_extrastats[id])
	
	player_damreduction[id] = (47.3057*(1.0-floatpower( 2.7182, -0.06798*float(player_agility[id])))/100)
	
	give_knife(id)
	
	return PLUGIN_HANDLED
} 


Did i miss something or mess something up?
Odpowiedz

  • +
  • -
Miczu - zdjęcie Miczu 07.05.2009

supertaranta, what was the point of coping everything? Do you want to load stats with save function? ;>
Odpowiedz

  • +
  • -
supertaranta - zdjęcie supertaranta 07.05.2009

Lol, no but u told me to copy it. so i have no idea what i should take out. lol
Odpowiedz

  • +
  • -
Miczu - zdjęcie Miczu 07.05.2009

format(vaultkey,63,"%s-%d-Dbmod",playerid,player_class[id])

format(vaultkey,63,"%s-Dbmod",playerid)

It's soo bad... no wonder it isn't working...


I would for start copy vaultkey formating from load to save.


Take a guess O:)
Odpowiedz

  • +
  • -
supertaranta - zdjęcie supertaranta 07.05.2009

oh >< lol... wow im a dumbass. ok so like this?

public SaveXP(id){
	new playerid[35];     
	get_user_authid(id,playerid,34); 
	
	replace_all(playerid, 34, " ", "")
	 
    	new vaultkey[64],vaultdata[256]
    	format(vaultkey,63,"%s-%d-Dbmod",playerid,player_class[id])
	replace_all(vaultdata, 255, "#", " ")
	
	new playerclass [33],playerxp[33],playerlvl[33],playerintelligence[33],playerstrength[33],playerpoint[33],playeragility[33],playerdextery[33]
	 
	parse(vaultdata, playerclass, 32, playerxp, 32, playerlvl, 32, playerintelligence, 32, playerstrength, 32, playerpoint, 32, playeragility, 32, playerdextery, 32)

	nvault_set(g_vault,vaultkey,vaultdata)
	return PLUGIN_HANDLED
} 
Odpowiedz

  • +
  • -
Miczu - zdjęcie Miczu 07.05.2009

Damm it! Wasn't looking close enough and i missed something. Didn't I tell you once, that to remove first format in the save function because it isn't doing any thing?

format(vaultkey,63,"%s-Dbmod",playerid)
format(vaultkey,63,"%s-%d-Dbmod",playerid,player_class[id])

A was mistaken, it was good enough to throw me out of track for a moment...


For now, that is code we are curently working on (and it's probably isn't working)
public SaveXP(id){ 
    new playerid[35];      
    get_user_authid(id,playerid,34);

    new vaultkey[64],vaultdata[256] 
    format(vaultkey,63,"%s-%d-Dbmod",playerid,player_class[id]) 
    format(vaultdata,255,"%i#%i#%i#%i#%i#%i#%i#%i",player_class[id],player_<img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />[id],player_lvl[id],player_intelligence[id],player_strength[id],player_point[id],player_agility[id],player_dextery[id]) 
    nvault_set(g_vault,vaultkey,vaultdata) 
    return PLUGIN_HANDLED 
} 
    
public LoadXP(id){ 
    new playerid[35];      
    get_user_authid(id,playerid,34); 

    new vaultkey[64],vaultdata[256] 
    format(vaultkey,63,"%s-%d-Dbmod",playerid,player_class[id]) 
    nvault_get(g_vault,vaultkey,vaultdata,255) 
    
    replace_all(vaultdata, 255, "#", " ") 
    
    new playerclass [33],playerxp[33],playerlvl[33],playerintelligence[33],playerstrength[33],playerpoint[33],playeragility[33],playerdextery[33] 
    
    parse(vaultdata, playerclass, 32, playerxp, 32, playerlvl, 32, playerintelligence, 32, playerstrength, 32, playerpoint, 32, playeragility, 32, playerdextery, 32) 
    
    player_class[id] = str_to_num(playerclass) 
    player_<img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />[id] = str_to_num(playerxp) 
    player_lvl[id] = str_to_num(playerlvl) 
    player_intelligence[id] = str_to_num(playerintelligence) 
    player_strength[id] = str_to_num(playerstrength) 
    player_point[id] = str_to_num(playerpoint) 
    player_agility[id] = str_to_num(playeragility) 
    player_dextery[id] = str_to_num(playerdextery) 
    BoostRing(id) 
    BoostStats(id,player_b_extrastats[id]) 
    
    player_damreduction[id] = (47.3057*(1.0-floatpower( 2.7182, -0.06798*float(player_agility[id])))/100) 
    
    give_knife(id) 
    
    return PLUGIN_HANDLED 
}

I'll try to look at it when I got some free time.
Odpowiedz

  • +
  • -
supertaranta - zdjęcie supertaranta 07.05.2009

Alright, im sorry. So this might still not work right? And when u do get some free time thanks a lot =).
Odpowiedz

  • +
  • -
Miczu - zdjęcie Miczu 07.05.2009

Try this:

public LoadXP(id){ 
    new playerid[35];      
    get_user_authid(id,playerid,34); 

    new vaultkey[64],vaultdata[256] 
    format(vaultkey,63,"%s-%d-Dbmod",playerid,player_class[id]) 
    
    client_print(id,print_console,"load_func_key %s",vaultkey)

    nvault_get(g_vault,vaultkey,vaultdata,255) 

    client_print(id,print_console,"load_func_data %s",vaultdata)
    
    replace_all(vaultdata, 255, "#", " ") 
    
    new playerclass [33],playerxp[33],playerlvl[33],playerintelligence[33],playerstrength[33],playerpoint[33],playeragility[33],playerdextery[33] 
    
    parse(vaultdata, playerclass, 32, playerxp, 32, playerlvl, 32, playerintelligence, 32, playerstrength, 32, playerpoint, 32, playeragility, 32, playerdextery, 32) 
    
    player_class[id] = str_to_num(playerclass) 
    player_<img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />[id] = str_to_num(playerxp) 
    player_lvl[id] = str_to_num(playerlvl) 
    player_intelligence[id] = str_to_num(playerintelligence) 
    player_strength[id] = str_to_num(playerstrength) 
    player_point[id] = str_to_num(playerpoint) 
    player_agility[id] = str_to_num(playeragility) 
    player_dextery[id] = str_to_num(playerdextery) 
    BoostRing(id) 
    BoostStats(id,player_b_extrastats[id]) 
    
    player_damreduction[id] = (47.3057*(1.0-floatpower( 2.7182, -0.06798*float(player_agility[id])))/100) 
    
    give_knife(id) 
    
    return PLUGIN_HANDLED 
}

Compile it and test it. It will only make some text apper in the console.

Copy the text here, it starts with load_func_key and load_func_data(that one could be quite long).
Odpowiedz

  • +
  • -
supertaranta - zdjęcie supertaranta 07.05.2009

What text am i looking for? Like i cheak in game consul nothing, and then on the server. nothing unusual =/
Odpowiedz

  • +
  • -
Miczu - zdjęcie Miczu 07.05.2009

supertaranta, after someone will run a load function (try to load his class) it should write something like:

load_func_key "Steam ID"-"number"-Dbmod
load_func_data number#number#number#number#number#number#number#number

If after compiling it and adding amxx file on your rerver it dosn't apper in console (somewhere in there) than load function isn't even called by the plugin...
Odpowiedz

  • +
  • -
supertaranta - zdjęcie supertaranta 07.05.2009

Alright yea nothing shows =(. so what now?
Odpowiedz

  • +
  • -
Miczu - zdjęcie Miczu 07.05.2009

Look truth whole file for LoadXP( and paste here functions where it appears (i probably take your whole fun from it but use search function for it :F).

If nothing call this function, it will never load...
Odpowiedz