-Skrypt Za wbicie lvl punkt do sms shopu i cc +2

Status
Zamknięty.

El Thiere

User
Zarejestrowany
Dołączył
Sierpień 24, 2009
Posty
38
Liczba reakcji
0
Siemka poszukuje skrypty kt?ry po wbiciu np 100lvl b?dzie przyznawac dla gracza po 1 - 10 pkt do SmS Shopu.

No i to samo tylko ze Crystal Coin's.


Z g?ry dzi?kuje Pozdrawiam El Thiere.
 
Odp: Za wbicie lvl punkt do sms shopu i cc +2

Przy??czam si? do pro?by. Ostatnio gra?em na pewnym serwerze i by? tam zastosowany taki motyw. Po wbiciu setnego poziomu otrzymywa?o si? 10pkt i 10cc i tak potem co pi??dziesi?t poziom?w si? to ci?gn??o. Bardzo fajny i przydatny spos?b.
 
Odp: Za wbicie lvl punkt do sms shopu i cc +2

cc:

PHP:
--- Created for otsmateria.com (c)----

function onAdvance(cid, type, oldlevel, newlevel)
if (oldlevel ~= newlevel and type == SKILL__LEVEL) then
if (newlevel >= 50 and getPlayerStorageValue(cid, 44562) == -1) then
doPlayerAddItem(cid, 2160, 5)
doPlayerSendTextMessage(cid,21,'Congratulations! You have reached level 50! As a special bonus Materia administrators, you have received 5 Cristal Coins.')
setPlayerStorageValue(cid, 44562, 1)
end
end
return true
end

pkt za level:

PHP:
--- Created for otsmateria.com (c)----

local config = {

levelReach = 500,

points = 100

}



function onAdvance(cid, skill, oldLevel, newLevel)



if(skill == SKILL__LEVEL and newLevel >= config.levelReach and getPlayerStorageValue(cid, 58558) == -1) then

setPlayerStorageValue(cid, 58558, 1)

db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points`+"..config.points.." WHERE `id` = "..getPlayerAccountId(cid)..";")

doPlayerSendTextMessage(cid,21,'Congratulations! You have reached level 500! As a special bonus Materia administrators, you have received 100 premium points.')

end



return TRUE

end

have fun
 
Odp: Za wbicie lvl punkt do sms shopu i cc +2

Mog?e? opisa? troch? jak przyst?pi? do edytowania skrypt?w dla w?asnej potrzeby. Poda?e? tylko gotowe pliki .LUA. Powinny si? tu jeszcze znale?? linijki do pliku (actions, movements, globalevents) nie wiem kt?rego bo si? dobrze na tym nie znam ale bez tych linijek skrypt g%#*no wart jest.
 
Odp: Za wbicie lvl punkt do sms shopu i cc +2

co tu wielce opisywa?? skrypt prosty i czytelny, a je?li masz jakie? w?tpliwo?ci to:

cc:
Kod:
--- Created for otsmateria.com (c)---- 
function onAdvance(cid, type, oldlevel, newlevel) 
if (oldlevel ~= newlevel and type == SKILL__LEVEL) then 
if (newlevel >= 50 and getPlayerStorageValue(cid, 44562) == -1) then -- 50 zmieniamy na level, przy kt?rym ma da? cc
doPlayerAddItem(cid, 2160, 5) -- tutaj mo?emy zmieni? cc na dowolny przedmiot podaj?c zamiast 2160 jego id, a 5 to ilo??
doPlayerSendTextMessage(cid,21,'Congratulations! You have reached level 50! As a special bonus Materia administrators, you have received 5 Cristal Coins.') 
setPlayerStorageValue(cid, 44562, 1) 
end 
end 
return true 
end

pkt:
Kod:
--- Created for otsmateria.com (c)---- 
local config = { 
levelReach = 500, -- level, za kt?ry dostajemy pkt
points = 100 -- ilo?? otrzymanych pkt
} 
function onAdvance(cid, skill, oldLevel, newLevel) 
if(skill == SKILL__LEVEL and newLevel >= config.levelReach and getPlayerStorageValue(cid, 58558) == -1) then 
setPlayerStorageValue(cid, 58558, 1) 
db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points`+"..config.points.." WHERE `id` = "..getPlayerAccountId(cid)..";") 
doPlayerSendTextMessage(cid,21,'Congratulations! You have reached level 500! As a special bonus Materia administrators, you have received 100 premium points.') 
end 
return TRUE 
end

oba skrypty wrzucamy do creaturescripts
Kod:
<event type="advance" name="skrypt" script="skrypt.lua"/>
 
Odp: Za wbicie lvl punkt do sms shopu i cc +2

Do skryptu nie mam zastrze?e? skrypt jest w rzeczy samej czy?ciutki i bezb??dny. Chodzi?o mi tylko o t? linijk? dla zielonych: (m.in. dla mnie :D)
<event type="advance" name="skrypt" script="skrypt.lua"/>
Dzi?ki za skrypt bo si? przyda.
REP+++
 
Odp: Za wbicie lvl punkt do sms shopu i cc +2

jezeli masz:
Kod:
function onAdvance(cid, type, oldlevel, newlevel)
to zawsze jest to creaturescripts.

i do login.lua wrzucasz jeszcze takie cos:
Kod:
	registerCreatureEvent(cid, "nazwa_skryptu")

Notka moderatorska:
+1 OT Expert [Request]
 
Ostatnio edytowane przez moderatora:
Odp: Za wbicie lvl punkt do sms shopu i cc +2

Mam ma?e pytanko. Dawno w to nei bawi??m si? ale

je?li chce np ?eby da?o te cc i pkt co 10lvl to tylko moge dodac w tym 1 skrypcie

if (newlevel >= 50 and getPlayerStorageValue(cid, 44562) == -1) then
if (newlevel >= 70 and getPlayerStorageValue(cid, 44562) == -1) then etc?

czy jak to tam idzie
 
Odp: Za wbicie lvl punkt do sms shopu i cc +2

sprawdz:

PHP:
--- Created for otsmateria.com (c)---- 
local config = { 
levelReach = 500, -- level, za kt?ry dostajemy pkt
points = 100 -- ilo?? otrzymanych pkt
} 
function onAdvance(cid, skill, oldLevel, newLevel) 
if(skill == SKILL__LEVEL and newLevel >= config.levelReach and getPlayerStorageValue(cid, 58558) == -1) then 
setPlayerStorageValue(cid, 58558, 1) 
db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points`+"..config.points.." WHERE `id` = "..getPlayerAccountId(cid)..";") 
doPlayerAddItem(cid, 2160, 5) -- tutaj mo?emy zmieni? cc na dowolny przedmiot podaj?c zamiast 2160 jego id, a 5 to ilo??
doPlayerSendTextMessage(cid,21,'Congratulations! You have reached level 500! As a special bonus Materia administrators, you have received 100 premium points.') 
end 
return TRUE 
end
 
Odp: Za wbicie lvl punkt do sms shopu i cc +2

no dobra ale ?eby dawa?o pkt co 20 lvl musze robi? ( a raczej kopiowa?) skrypt na inny poziom co nie ?
 
Odp: Za wbicie lvl punkt do sms shopu i cc +2

Mam ma?e pytanko. Dawno w to nei bawi??m si? ale
je?li chce np ?eby da?o te cc i pkt co 10lvl to tylko moge dodac w tym 1 skrypcie
if (newlevel >= 50 and getPlayerStorageValue(cid, 44562) == -1) then
if (newlevel >= 70 and getPlayerStorageValue(cid, 44562) == -1) then etc?
czy jak to tam idzie

Napewno da si? w 1 skrypcie lecz to nie b?dzie zawsze (cid, 44562)
poniewa? mi si? wydaje, ?e storageid zawsze inne..
 
Odp: Za wbicie lvl punkt do sms shopu i cc +2

Nie koniecznie storage id musi by? inne, po co za?mieca? baz? jak mo?na, za ka?dym rewardem tylko zwi?ksza? value o 1 ?

@edit:Prosze pisany na szybko w edytorze forum skrypt na pp i cc razem: (skrypt oczywi?cie do creaturescript)
PHP:
function onAdvance(cid, type, oldlevel, newlevel) 
	local config = {
		storage = 98960,
		levels = {
		[100] = {itemId = 2160, itemCount = 5, storageValue = 1, pp = 10},
		[120] = {itemId = 2160, itemCount = 5, storageValue = 2, pp = 10},
		[140] = {itemId = 2160, itemCount = 5, storageValue = 3, pp = 10},
		[160] = {itemId = 2160, itemCount = 5, storageValue = 4, pp = 10},
		[180] = {itemId = 2160, itemCount = 5, storageValue = 5, pp = 10},
		[200] = {itemId = 2160, itemCount = 5, storageValue = 6, pp = 10}}}
	local param = string.lower(param)
	if isPlayer(cid)
		if (oldlevel ~= newlevel and type == SKILL__LEVEL) then 
			if (newlevel == config.levels[param] and getPlayerStorageValue(cid, config.storage) < config.level[param].storageValue) then
				doPlayerAddItem(cid, config.levels[param].itemId, config.levels[param].itemCount)
				db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points`+"..config.levels[param].pp.." WHERE `id` = "..getPlayerAccountId(cid)..";") 
				doPlayerSendTextMessage(cid, 21 ,'Congratulations! You have reached level ' ..newLevel.. '! You have received 5 Cristal Coins.') 
				setPlayerStorageValue(cid, config.storage, config.levels[param].storageValue) 
			end 
		end
	end
	return true 
end

do login.lua wklejasz to:
Kod:
registerCreatureEvent(cid, "nazwa_skryptu")
do creaturescript.xml to
Kod:
<event type="advance" name="skrypt" script="skrypt.lua"/>

Opis configu:
Storage - storage jakie ma nadawa? skrypt,
[liczba] - level przy kt?rym dodaje itemy,
itemId - id item'u jaki ma dosta? gracz,
itemCount - ilosc item?w jakie ma dosta? gracz (np. itemId = 2160, itemCount = 5 --- player dostanie 5cc),
storageValue - warto?? storage z configu jakie ma przypisa? skrypt,
pp - ilo?? punkt?w premium jakie ma dosta? player.

PS. Nie wiem czy dzia?a nie testowany i dopiero si? ucz? lua.
 
Ostatnia edycja:
Status
Zamknięty.
Back
Do góry