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

Script Problem.


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

#21 supertaranta

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
zer0.

  • Postów:55
Offline

Napisano 20.04.2009 21:49

Oh ok, i understand, one more thing. How can i change the nvault save from the NAME save to Steam ID save.

new name[32];     
	get_user_name(id,name,31);
	
	replace_all(name, 31, " ", "'")
	 
	new vaultkey[64],vaultdata[256]
	format(vaultkey,63,"%s-Dbmod",name)
	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

  • +
  • -
  • 0

#22 Miczu

    Godlike

  • Przyjaciel

Reputacja: 646
Wszechmogący

  • Postów:2862
Offline

Napisano 20.04.2009 21:50

get_user_authid

http://www.amxmodx.o...?go=func&id=166
  • +
  • -
  • 0

#23 supertaranta

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
zer0.

  • Postów:55
Offline

Napisano 20.04.2009 21:56

Oh alright. thanks a lot, hey if there is a way i could possibly donate to u =) for all your help and everything. In a bit im going to try to add the key thing and if you could see what im missing that would be great.

[ Added: 20-04-2009, 23:06 ]
public SaveXP(id){
	new playerid[32];     
	get_user_authid(id,playerid,MAX_ID_LENGTH-1);
	
	replace_all(playerid, MAX_ID_LENGTH-1, " ", "'")
	 
	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[32];     
	get_user_authid(id,playerid,MAX_ID_LENGTH-1);
	
	replace_all(playerid, MAX_ID_LENGTH-1, " ", "'")
	 
	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_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
} 


Would this be proper?
  • +
  • -
  • 0

#24 Miczu

    Godlike

  • Przyjaciel

Reputacja: 646
Wszechmogący

  • Postów:2862
Offline

Napisano 20.04.2009 22:17

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

steam have max 34 chars
replace_all(playerid, MAX_ID_LENGTH-1, " ", "'") - steam dont have spaces " " in it so it isn't needed.

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

format will erase all data before entering new data (so single format [the secound one] will be only in vaultkey)

format(vaultdata,255,"%i#%i#%i#%i#%i#%i#%i#%i",player_class[id] playerclass is in kay so it isn't nesesery in data.

LoadXP funktion is pretty bad to...

nvault_get(g_vault,vaultkey,vaultdata,255)

in vaultdata will be stored (formated before that) all data from database so don't see the point of formating data there...
  • +
  • -
  • 0

#25 supertaranta

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
zer0.

  • Postów:55
Offline

Napisano 20.04.2009 22:19

Oh wow :/ that was horrible for my part. Alright, well this should save seperatly is that correct?


Edit1: oh and for the load instead of all the i just need the get_vault thing?



Edit2:

public SaveXP(id){
	new playerid[35];     
	get_user_authid(id,playerid,34); 
	
	replace_all(playerid, MAX_ID_LENGTH-1, " ", "")
	 
	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_<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){
	
	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
} 



Do i need to delete al lteh player_class things like the new player class [33]?
  • +
  • -
  • 0

#26 Miczu

    Godlike

  • Przyjaciel

Reputacja: 646
Wszechmogący

  • Postów:2862
Offline

Napisano 20.04.2009 22:28

Don't worry I'm still impresed that you could keep with me for so long (maybe i write it more clear in english then im my own lang? xD).

To tell the truth even if code will look ok it could have some gliches like letter in frong place or somethin less important and it will not work. So for now i think about removing step by step every bad code that can be spoted and then test it, debug, test, debug and after some time it should work.

I'm pretty good in that... in 5 minutes i can run over 20 (or less - dam plug have long compiling time) fast test and removing those dam bugs xD
  • +
  • -
  • 0

#27 Miczu

    Godlike

  • Przyjaciel

Reputacja: 646
Wszechmogący

  • Postów:2862
Offline

Napisano 20.04.2009 22:29

in load you need only format correctly vaultkey that you can find your data in database

Do i need to delete al lteh player_class things like the new player class [33]?

in that is stored what class you have in the game when you play really important for all classes bonuses....
  • +
  • -
  • 0

#28 supertaranta

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
zer0.

  • Postów:55
Offline

Napisano 20.04.2009 22:33

haha, =), btw i am polish. haha, just i cant write in it, which annoys me. i can speak it, and read some what lol, just cant write.... lol. But yea i can keep up, i really want this thats y. Hmm alright ill try to compile and find out. Could you do me a huge favor though? Can you see whats wrong with the /classes problem, Because everytime in game when i do /classes it just dissappears same with the skills. Heres the code fro those two parts.

register_clcmd("say /skills", "showskills")
	register_clcmd("say /classes","show_menu_klasy")

	register_menucmd(register_menuid("Skill Menu"), 1023, "skill_menu")
	register_menucmd(register_menuid("Class Info"), 1023, "klasy")
	register_menucmd(register_menuid("Options"), 1023, "option_menu")
	register_menucmd(register_menuid("Select Class"), 1023, "select_class_menu")
	register_menucmd(register_menuid("Rune Shop"), 1023, "select_rune_menu")
	register_menucmd(register_menuid("New Items"), 1023, "nowe_itemy")



public showskills(id)
{
	new Skillsinfo[768]
	format(Skillsinfo,767,"You have %i strength - this give you %i extra hitpoints

You have %i Dextery - this give a speed boost of %i% and reduce magic damage taken with %i%%

You have %i Agility - Helps to find unique items and reduce damage from normal attacks by %0.0f%%

You have %i intelligence - this will make the USE items more efficient
",
	player_strength[id],
	player_strength[id]*2,
	player_dextery[id],
	floatround(player_dextery[id]*1.3),
	player_dextery[id]*3,
	player_agility[id],
	player_damreduction[id]*100,
	player_intelligence[id])
	
	showitem(id,"Skills","None","None", Skillsinfo)
}



public skilltree(id)
{
	new text[513] 
	new keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)
	
	
	format(text, 512, "ySelect skill - rPoints: %i^n^nw1. Intelligence [%i] [More Spell Damage]^nw2. Strength [%i] [More Hitpoints]^nw3. Agility [%i] [Damage reduction]^nw4. Dextery [%i] [Improved Speed and Magic damage reduction]",player_point[id],player_intelligence[id],player_strength[id],player_agility[id],player_dextery[id]) 
	
	keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)
	show_menu(id, keys, text) 
	return PLUGIN_HANDLED  
} 


public skill_menu(id, key) 
{ 
	switch(key) 
	{ 
		case 0: 
		{	
			if (player_intelligence[id]<50){
				player_point[id]-=1
				player_intelligence[id]+=1
			}
			else client_print(id,print_center,"You have maxed out the intelligence skill")
			
		}
		case 1: 
		{	
			if (player_strength[id]<50){
				player_point[id]-=1	
				player_strength[id]+=1
			}
			else client_print(id,print_center,"You have maxed out the strength skill")
		}
		case 2: 
		{	
			if (player_agility[id]<50){
				player_point[id]-=1
				player_agility[id]+=1
				player_damreduction[id] = (47.3057*(1.0-floatpower( 2.7182, -0.06798*float(player_agility[id])))/100)
			}
			else client_print(id,print_center,"You have maxed out the agility skill")
			
		}
		case 3: 
		{	
			if (player_dextery[id]<50){
				player_point[id]-=1
				player_dextery[id]+=1
				set_speedchange(id)
			}
			else client_print(id,print_center,"You have maxed out the dextery skill")
		}
	}
	
	if (player_point[id] > 0) 
		skilltree(id)
	
	
	return PLUGIN_HANDLED
}


[b]Klasy =)[/b]

public show_menu_klasy(id)
{
	new text[513]

	format(text, 512, "yinfo Class - ^nw1. Sorcerer^nw2. Paladin^nw3. Monk^nw4. Barbarian^nw5. Assassin^nw6. Necromancer^nw7. Ninja^nw8. Hunter^n^nw0. Close") 

	new keys 
	keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<9)
	show_menu(id, keys, text) 
	return PLUGIN_HANDLED  
} 

public klasy(id, key) 
{ 
	switch(key) 
	{ 
		case 0: 
		{	
			mag(id)
			
		}
		case 1: 
		{	
			paladyn(id)
		}
		case 2: 
		{	
			mnich(id)
		}
		case 3:
		{
			barbarzynca(id)
		}
		case 4:
		{
			zabojca(id)
		}
		case 5:
		{
			nekromanta(id)
		}
		case 6:
		{
			ninja(id)
		}
		case 7:
		{
			Lowca(id)
		}
		case 9:
		{
			return PLUGIN_HANDLED
		}
	}
	
	return PLUGIN_HANDLED
}
public mag(id){
	showitem(id,"Sorcerer"," "," ","
Shooting from a pistol you freeze your opponent and take 5hp every 2 seconds for 15 seconds.
 Using your flashlight you are able to see invisible players

")
}
public paladyn(id){
	showitem(id,"Paladin"," "," ","
Starts with 125hp and can cast Long Jump.
 

")
}
public mnich(id){
	showitem(id,"Monk"," "," ","
You gain experiance faster
Starts with 140hp

")
}
public barbarzynca(id){
	showitem(id,"Barbarian"," "," ","
Killing an enemy you recieve 200 armor and
You recieve extra clips
And regain extra hp.

")		
}
public zabojca(id){
	showitem(id,"Assassin"," "," ","
You are unable to hear his footsteps and he is faster then other classes.
When shooting a enemy with a pistol you eject them to mid air.

")
}
public nekromanta(id){
	showitem(id,"Necromancer"," "," ","
Attacking you damage 10hp more
and can resurrect the dead.

")
}
public ninja(id){
	showitem(id,"Ninja"," "," ","
You are almost invisible and have 165hp to start with
But is able only to use a knife.

")
}
public Lowca(id){
	showitem(id,"Hunter"," "," ","
Has a crossbow (take knife out and press reload)
You can set up trap out of HE's(Change grenade mode with alternative fire)
When shooting the enemy with a pistol, they leave a trail behind.

")
}


[ Added: 20-04-2009, 23:39 ]
Hmm, how do i define Vaultkey and VaultData? and also the max_id_lenght? Sorry for the really nooby question.
  • +
  • -
  • 0

#29 Miczu

    Godlike

  • Przyjaciel

Reputacja: 646
Wszechmogący

  • Postów:2862
Offline

Napisano 20.04.2009 22:41

If you didn't change anything in it, it should work (i think)... to tell the truth i didn't open code for dbmod for even a second while our convesation :F

There are to many things that can go wrong in something this big so thats why i only can support only my work and some people that help me with it (and i know exacly what and where are made changes and I accept only working code to the next version)...

Hmm, how do i define Vaultkey and VaultData? and also the max_id_lenght? Sorry for the really nooby question.


key and data is a strin so simply:

new string[max_lenght]

but you have to remember to use always 1 less then in the stirn declaration (like new data[33] format(data,32,"xx") ).

Max players on server is 32 so max nubers of id declerated is 33 - all players_* is [33]
  • +
  • -
  • 0

#30 supertaranta

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
zer0.

  • Postów:55
Offline

Napisano 20.04.2009 22:45

Well im pretty positive thats all from the 5.9l and all i changed where the language, translating. So like i dunno, because the skills dont add, Would that be because i changed it to nvault?
  • +
  • -
  • 0

#31 Miczu

    Godlike

  • Przyjaciel

Reputacja: 646
Wszechmogący

  • Postów:2862
Offline

Napisano 20.04.2009 22:49

There is something like law in programing... more changes you make before testing them them you can be more shure that something will not work and you will have hard time to find what xD
  • +
  • -
  • 0

#32 supertaranta

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
zer0.

  • Postów:55
Offline

Napisano 20.04.2009 22:51

Uh huh, well mainly all i did was take out the sql hehe, I will try editing again, Where do u place the New data [33] format.... so on. and the new string.
  • +
  • -
  • 0

#33 Miczu

    Godlike

  • Przyjaciel

Reputacja: 646
Wszechmogący

  • Postów:2862
Offline

Napisano 20.04.2009 22:54

Oh i know whats wrong in those menus (suprised)

register_menucmd(register_menuid("Skill Menu"), 1023, "skill_menu")
register_menucmd(register_menuid("Class Info"), 1023, "klasy")
register_menucmd(register_menuid("Options"), 1023, "option_menu")
register_menucmd(register_menuid("Select Class"), 1023, "select_class_menu")
register_menucmd(register_menuid("Rune Shop"), 1023, "select_rune_menu")
register_menucmd(register_menuid("New Items"), 1023, "nowe_itemy")

this text need to be on front of the formated text but you translated it and now pluging can't find what you want to open
  • +
  • -
  • 0

#34 supertaranta

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
zer0.

  • Postów:55
Offline

Napisano 20.04.2009 22:56

Oh so i need to change it back?
  • +
  • -
  • 0

#35 Miczu

    Godlike

  • Przyjaciel

Reputacja: 646
Wszechmogący

  • Postów:2862
Offline

Napisano 20.04.2009 22:58

or you could try to chang bold text in plugin_init

PS. It's 6 hour later by my then in new york so you can be shoure that i will pass out in some time soon xD
  • +
  • -
  • 0

#36 supertaranta

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
zer0.

  • Postów:55
Offline

Napisano 20.04.2009 23:00

Ah yea i know, btw what part of poland? Oh and also, from before. where exactly do i place the new data? and the string thing? so they are defined.



Edit1: isnt the bold text, what i changed?
  • +
  • -
  • 0

#37 Miczu

    Godlike

  • Przyjaciel

Reputacja: 646
Wszechmogący

  • Postów:2862
Offline

Napisano 20.04.2009 23:08

My bad i should write it better... They work in pairs:

register_menucmd(register_menuid("Class Info"), 1023, "klasy")
+
public show_menu_klasy(id)
{
new text[513]

format(text, 512, "yinfo Class - ^nw1. Sorcerer^nw2. Paladin^nw3. Monk^nw4. Barbarian^nw5. Assassin^nw6. Necromancer^nw7. Ninja^nw8. Hunter^n^nw0. Close")

new keys
keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<9)
show_menu(id, keys, text)
return PLUGIN_HANDLED
}

something like that

here exactly do i place the new data? and the string thing? so they are defined.


plese define "data" there is to many in here and every time it meen someting else :D
You asked how to declarate a string so i writed how, it isn't neseserly needed or correct in your situation ;-)
  • +
  • -
  • 0

#38 supertaranta

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
zer0.

  • Postów:55
Offline

Napisano 20.04.2009 23:18

You wrote this right.
key and data is a strin so simply:

new string[max_lenght]

but you have to remember to use always 1 less then in the stirn declaration (like new data[33] format(data,32,"xx") ).

Max players on server is 32 so max nubers of id declerated is 33 - all players_* is [33]

Where do i place all that?

because these are the errors.

/home/groups/amxmodx/tmp3/phpqTwuYH.sma(619) : error 017: undefined symbol "MAX_ID_LENGTH"
/home/groups/amxmodx/tmp3/phpqTwuYH.sma(631) : error 017: undefined symbol "vaultkey"
/home/groups/amxmodx/tmp3/phpqTwuYH.sma(631) : error 017: undefined symbol "vaultdata"
/home/groups/amxmodx/tmp3/phpqTwuYH.sma(631) : warning 215: expression has no effect
/home/groups/amxmodx/tmp3/phpqTwuYH.sma(631) : error 001: expected token: ";", but found ")"
/home/groups/amxmodx/tmp3/phpqTwuYH.sma(631) : fatal error 107: too many error messages on one line

Compilation aborted.
5 Errors.


[ Added: 21-04-2009, 00:19 ]
Refering to the top post. so i place each of those things before its public?
  • +
  • -
  • 0

#39 Miczu

    Godlike

  • Przyjaciel

Reputacja: 646
Wszechmogący

  • Postów:2862
Offline

Napisano 20.04.2009 23:22

Simply copy from save format:

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

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

MAX_ID_LENGTH - use real number that is max lenght or something...
  • +
  • -
  • 0

#40 supertaranta

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
zer0.

  • Postów:55
Offline

Napisano 20.04.2009 23:24

Oh >< haha. alright wow im stupid lol. and so the whole menu things i just add them before the public right?
  • +
  • -
  • 0




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

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