Register for your free account! | Forgot your password?

You last visited: Today at 02:58

  • Please register to post and access all features, it's quick, easy and FREE!

 

LUA

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2015
Posts: 56
Received Thanks: 1
Post LUA

Its me again
I have some list of quetions about LUA and gs commands... I know that this forum have a lot of topics about this and I can find solution on this.
But I need some communication with others.

So lets start)
1)First of all, there can I find scrips of item( for example item_id is - 930040 (this stuff change nickname of your player, but on row item_script is nothing))
2)How I can change nickname of player. (I try to do this with sql)
or with commands :
local nick = gv("name")
set_value("<#006400>"..nick, nick)

but...nothing of this is working
3)Where placed windows of something (for example window that say how exp you lost)

Sorry for my eng. Im trying to learn it



Gordor1 is offline  
Old   #2
 
elite*gold: 30
Join Date: Mar 2012
Posts: 625
Received Thanks: 280
1) as i remember, the nickname change ticket is hardcoded stuff, it doesnt have that simple LUA implemented functionality.
2.1) gameserver does not support real-time data export from database, so you need to force character data update from database to make it working that way. traditionally, the only one way to force such update is relog into game from character selection window, which is unusable for your purposes.
simplier words, if you set some data into database using raw query, you need to take it back into server memory using gameserver (not lua) functions that causes that data to set into a memory.
otherwise, you will need to create a gameserver add-in that connects to its telnet management port and bring the data you need back into memory in real time, that requires pretty well coding skills.
2.2) if you copypasted your script, then remember one simple thing: strings concatenation in LUA only working when you use spaces at the sides of concatenation operator (consider using " .. " instead of ".."). anyways, i already made such thing as character nickname color change on my past server so its the one and only right way. anyways, be ready to meet a lot of bugs that way.
2.3) you messed with set_value parameters. function has parameters (value_type, value [, nickname]).
consider using set_value("name", "<#blahblah>" .. nick, nick) or even not use the third parameter if you set the script function for an item that will be used by a character to have an effect on himself.
3) for "the exp you lost" chat message, there is a string written in StringResource, which looks something like "you died and lost #@[email protected]# experience".


mongreldogg is offline  
Reply



« Previous Thread | Next Thread »



All times are GMT +2. The time now is 02:58.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy
Copyright ©2017 elitepvpers All Rights Reserved.