Skocz do zawartości

  • Zaloguj korzystając z Facebooka Zaloguj korzystając z Twittera Zaloguj przez Steam Zaloguj poprzez Google      Logowanie »   
  • Rejestracja

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.

  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

Saving Problem.


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
26 odpowiedzi w tym temacie

#1 supertaranta

    Pomocny

  • Użytkownik

Reputacja: 0
zer0.

  • Postów:55
Offline

Napisano 06.05.2009 21:59

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.
  • +
  • -
  • 0

#2 Miczu

    Godlike

  • Przyjaciel

Reputacja: 646
Wszechmogący

  • Postów:2862
Offline

Napisano 06.05.2009 22:15

supertaranta, have you after disconnect and connect while the same map lvl from time when you disconnected?
  • +
  • -
  • 0

#3 supertaranta

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
zer0.

  • Postów:55
Offline

Napisano 07.05.2009 02:25

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. =/
  • +
  • -
  • 0

#4 Miczu

    Godlike

  • Przyjaciel

Reputacja: 646
Wszechmogący

  • Postów:2862
Offline

Napisano 07.05.2009 10:03

Is that your version od mod? (edited saving to nvault version?)
  • +
  • -
  • 0

#5 supertaranta

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
zer0.

  • Postów:55
Offline

Napisano 07.05.2009 11:36

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='http://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='http://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
} 

  • +
  • -
  • 0

#6 Miczu

    Godlike

  • Przyjaciel

Reputacja: 646
Wszechmogący

  • Postów:2862
Offline

Napisano 07.05.2009 11:58

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...
  • +
  • -
  • 0

#7 supertaranta

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
zer0.

  • Postów:55
Offline

Napisano 07.05.2009 12:08

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.
  • +
  • -
  • 0

#8 Miczu

    Godlike

  • Przyjaciel

Reputacja: 646
Wszechmogący

  • Postów:2862
Offline

Napisano 07.05.2009 15:27

You have to write the same key for save and load. I would for start copy vaultkey formating from load to save.
  • +
  • -
  • 0

#9 supertaranta

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
zer0.

  • Postów:55
Offline

Napisano 07.05.2009 20:23

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='http://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='http://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?
  • +
  • -
  • 0

#10 Miczu

    Godlike

  • Przyjaciel

Reputacja: 646
Wszechmogący

  • Postów:2862
Offline

Napisano 07.05.2009 20:46

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

#11 supertaranta

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
zer0.

  • Postów:55
Offline

Napisano 07.05.2009 21:09

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

#12 Miczu

    Godlike

  • Przyjaciel

Reputacja: 646
Wszechmogący

  • Postów:2862
Offline

Napisano 07.05.2009 21:14

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:)
  • +
  • -
  • 0

#13 supertaranta

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
zer0.

  • Postów:55
Offline

Napisano 07.05.2009 21:20

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
} 

  • +
  • -
  • 0

#14 Miczu

    Godlike

  • Przyjaciel

Reputacja: 646
Wszechmogący

  • Postów:2862
Offline

Napisano 07.05.2009 21:30

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='http://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='http://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.
  • +
  • -
  • 0

#15 supertaranta

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
zer0.

  • Postów:55
Offline

Napisano 07.05.2009 21:33

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

#16 Miczu

    Godlike

  • Przyjaciel

Reputacja: 646
Wszechmogący

  • Postów:2862
Offline

Napisano 07.05.2009 21:38

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='http://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).
  • +
  • -
  • 0

#17 supertaranta

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
zer0.

  • Postów:55
Offline

Napisano 07.05.2009 21:46

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

#18 Miczu

    Godlike

  • Przyjaciel

Reputacja: 646
Wszechmogący

  • Postów:2862
Offline

Napisano 07.05.2009 21:51

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...
  • +
  • -
  • 0

#19 supertaranta

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
zer0.

  • Postów:55
Offline

Napisano 07.05.2009 21:54

Alright yea nothing shows =(. so what now?
  • +
  • -
  • 0

#20 Miczu

    Godlike

  • Przyjaciel

Reputacja: 646
Wszechmogący

  • Postów:2862
Offline

Napisano 07.05.2009 21:59

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...
  • +
  • -
  • 0




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych