What's new

Efekt po awansie

Status
Not open for further replies.

gadery

Active User
Joined
Mar 28, 2011
Messages
53
Reaction score
3
Witam. pr?bowa?em napisa? skrypt, w kt?rym po awansie postaci na ka?dy kolejny lvl wida? jaki? wy?wietlany "efekt" oraz po awansie na 20 lvl dostajemy kas?. Nie mniej jednak pr?ba zosta?a zako?czona niepowodzeniem - skrypt nie dzia?a je?li kto? widzi jaki? b??d w kodzie prosz? o porady:

<event type="advance" name="Getmoney" event="script" value="getmoney.lua"/>

Code:
local config = 
{
	levelReach = 20,
      item = 2160,
      count = 20
}




function onAdvance(cid, oldlevel, newlevel)
	    registerCreatureEvent(getPlayerPosition(cid), "Getmoney")
	 
		if(skill == SKILL__LEVEL and newLevel >= config.levelReach and getPlayerStorageValue(cid, 58557) == -1) then
	      	setPlayerStorageValue(cid, 58557, 1)
        	doPlayerAddItem(cid, config.item, config.count)
	end
 	return TRUE

	end
 
T

Thomass

Guest
Odp: Efekt po awansie

PHP:
local config = 
{
      levelReach = 20,
      item = 2160,
      count = 20
}
function onAdvance(cid, oldlevel, newlevel)
	  if getPlayerSkill(uid) == 10 and NewLevel >= config.levelReach and getPlayerStorageValue(cid, 58557) == -1) then
         doPlayerAddItem(cid, config.item, config.count)
	     setPlayerStorageValue(cid, 58557, 1)
        	
	end
 	return TRUE
	end

Nie sprawdza?em, ale co? w tym stylu powinno by?. ;)
 
Status
Not open for further replies.
Top