What's new

Talkactions Komenda /exp

Status
Not open for further replies.

dami1310

Poskramiacz Internet?w
Joined
Jun 1, 2009
Messages
1,385
Reaction score
113
Skrypt nie jest jaki? zaawansowany, ale komu? mo?e si? przyda?.

Komenda:
/exp nick, ilo??

Opis:
Jest to po prostu dodawanie okre?lonej ilo?ci expa komend?.

Przyk?ad prawid?owego u?ycia:
/exp Gracz, 100

Przyk?ad nieprawid?owego u?ycia:
/exp Gracz 100

W talkactions/scripts robimy plik experience.lua i dodajemy tam:
Code:
function onSay(cid, words, param)
	local t = string.explode(param, ",")
	local tid = getPlayerByNameWildcard(t[1])
	if(not t[2]) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")
		return true
	elseif(not tid or (isPlayerGhost(tid) and getPlayerGhostAccess(tid) > getPlayerGhostAccess(cid))) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player ".. t[1] .." not found.")
		return true
	else
		doPlayerAddExperience(tid, t[2])
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have added ".. t[2] .." experience to player ".. t[1] ..".")
	end

	return true
end

W talkactions.xml dodajemy linijk?:
Code:
<talkaction log="yes" words="/exp" access="5" event="script" value="experience.lua"/>

Pozdrawiam, dami1310~
 

Placek

Blue Waffle
Joined
Sep 30, 2008
Messages
6,793
Reaction score
672
Age
9
Odp: Komenda /exp

Hmm, nie wiem co czego by to mozna wykorzystac. Bo komenda /addskill juz jest i levele dodawac i odejmowac mozna... A tu co? Expa tylko? To jak chcesz dodac 5 leveli to musisz sobie recznie liczyc, czy jak?
 

DanJ93

ElfBot Helper
Joined
Jan 18, 2009
Messages
2,631
Reaction score
200
Odp: Komenda /exp

Hmm, nie wiem co czego by to mozna wykorzystac. Bo komenda /addskill juz jest i levele dodawac i odejmowac mozna... A tu co? Expa tylko? To jak chcesz dodac 5 leveli to musisz sobie recznie liczyc, czy jak?
Mo?e si? przyda? pod bardziej RPG, nagroda w konkursie np. Tw?j level * 1000 = wygrany exp
 
Status
Not open for further replies.
Top