• 01-04.05.2026 - DOUBLE EXP / SKILL EVENT!

Skrypty & Kody komenda !soft (8.10)

Status
Zamknięty.

ArtekXDPL94

User
Zarejestrowany
Dołączył
Kwiecień 20, 2016
Posty
20
Liczba reakcji
0
Prosz? o naprawienie tego kodu, na komend? !soft, kt?ra ma naprawia? zniszczone soft bootsy.
Kod ma dzia?a? pod wersje 8.1
Posiadam silnik Aries 0.4.0

Kod:
local config = {
stare = 6530, -- id zepsutych
nowe = 2640, 
cost = 10000,
good_effect = 29, 
fail_effect = 2, 
no_money = "Nie masz pieniedzy",
no_soft = "Nie masz soft\'ow",
good = "Naladowales softy !"
}
function onSay(cid, words, param)

if(getPlayerMoney(cid) >= config.cost) then
		if(getPlayerItemCount(cid, config.stare) > 0) then
			doSendMagicEffect(getCreaturePosition(cid), config.good_effect)
			doPlayerSendTextMessage(cid, 22, config.good)
			doPlayerRemoveItem(cid, config.stare, 1)
			doPlayerAddItem(cid, config.nowe, 1)
		else
			doPlayerSendTextMessage(cid, 22, config.no_soft)
			doSendMagicEffect(getCreaturePosition(cid), config.fail_effect)
		end
else
	doPlayerSendTextMessage(cid,22, config.no_money)
	doSendMagicEffect(getCreaturePosition(cid), config.fail_effect)
end

return 1
end

Taki b??d pojawia si? u mnie:
errorjpg_saexqeh.jpg
 
Odp: komenda !soft (8.10)

Je?li chodzi o softy to znalaz?em takie co? na torg.pl

-- Repair soft boots in talkactions by Avixu
-- Dedicated for Aries 0.4.0
-- Talkactons.XML: <talkaction words="!repair" script="repair_soft_boots.lua" />

local config = {
repairPrice = 10000
}

function onSay(cid, words, param)
if getPlayerItemCount(cid, 6530) >= 1 then
if(not doPlayerRemoveMoney(cid, confg.repairPrice)) then
doPlayerTakeItem(cid, 6530, 1)
doPlayerAddItem(cid, 6132, 1)
doPlayerSendTextMessage(cid, 19, 'Soft Boots repaired!')
doSendAnimatedText(getPlayerPos(cid), 'Success!', TEXTCOLOR_DARKRED)
else
doPlayerSendCancel(cid, 'Sorry, you don\'t have enough money.')
end
else
doPlayerSendCancel(cid, 'Sorry, you don\'t have a pair of worn soft boots.')
end
end

Nie powiem Ci czy dzia?a musisz sam sprawdzi? :P
Akurat do twojego Ariesa ^_^
 
Odp: komenda !soft (8.10)

Niestety ale nie dzia?a, mam taki b??d:
error2jpg_sawxawn.jpg


Wie kto? jak to naprawi??
 
Odp: komenda !soft (8.10)

literowka zaistniala.

[lua]-- Repair soft boots in talkactions by Avixu
-- Dedicated for Aries 0.4.0
-- Talkactons.XML: <talkaction words="!repair" script="repair_soft_boots.lua" />

local config = {
repairPrice = 10000
}

function onSay(cid, words, param)
if getPlayerItemCount(cid, 6530) >= 1 then
if(not doPlayerRemoveMoney(cid, config.repairPrice)) then
doPlayerTakeItem(cid, 6530, 1)
doPlayerAddItem(cid, 6132, 1)
doPlayerSendTextMessage(cid, 19, 'Soft Boots repaired!')
doSendAnimatedText(getPlayerPos(cid), 'Success!', TEXTCOLOR_DARKRED)
else
doPlayerSendCancel(cid, 'Sorry, you don\'t have enough money.')
end
else
doPlayerSendCancel(cid, 'Sorry, you don\'t have a pair of worn soft boots.')
end
end[/lua]
 
Odp: komenda !soft (8.10)

Okej teraz dzia?a ale nieprawid?owo, wpisuje komend? zabiera kas? ale soft?w nie naprawia. Poprawi kto? kod?
 
Odp: komenda !soft (8.10)

Spr?buj:
[lua]-- Repair soft boots in talkactions by Avixu
-- Dedicated for Aries 0.4.0
-- Talkactons.XML: <talkaction words="!repair" script="repair_soft_boots.lua" />

local config = {
repairPrice = 10000
}

function onSay(cid, words, param)
if getPlayerItemCount(cid, 6530) >= 1 then
if(not doPlayerRemoveMoney(cid, config.repairPrice)) then
doPlayerSendCancel(cid, 'Sorry, you don\'t have enough money.')
else
doPlayerTakeItem(cid, 6530, 1)
doPlayerAddItem(cid, 6132, 1)
doPlayerSendTextMessage(cid, 19, 'Soft Boots repaired!')
doSendAnimatedText(getPlayerPos(cid), 'Success!', TEXTCOLOR_DARKRED)
end
else
doPlayerSendCancel(cid, 'Sorry, you don\'t have a pair of worn soft boots.')
end
end[/lua]
 
Odp: komenda !soft (8.10)

Okej - teraz naprawia, ale nadal s? b??dy:
Gdy gracz ma kas? - to zabiera 1 cc, a gdy nie ma kasy w og?le - to naprawia za darmo.
Dodatkowo taki b??d w konsoli:
error3jpg_sawnhwe.jpg
 
Odp: komenda !soft (8.10)

[Lua]-- Repair soft boots in talkactions by Avixu
-- Dedicated for Aries 0.4.0
-- Talkactons.XML: <talkaction words="!repair" script="repair_soft_boots.lua" />

-- NAPRAWIONE PRZEZ MISZCZU #NOOB XD [PROSZE NIE USUWAC]

local config = {
repairPrice = 10000
}

function onSay(cid, words, param)
if getPlayerItemCount(cid, 6530) >= 1 then
if(doPlayerRemoveMoney(cid, config.repairPrice)) then
doPlayerTakeItem(cid, 6530, 1)
doPlayerAddItem(cid, 6132, 1)
doPlayerSendTextMessage(cid, 19, 'Soft Boots repaired!')
return true
else
doPlayerSendCancel(cid, 'Sorry, you don\'t have enough money.')
return true
end
else
doPlayerSendCancel(cid, 'Sorry, you don\'t have a pair of worn soft boots.')
return true
end
end[/Lua]
Testowa?em u siebie i ?miga.
 
Odp: komenda !soft (8.10)

Naprawi?e? tylko b??d z konsoli, ale dalej dzia?a nieprawid?owo - gdy nie masz kasy naprawia softy za darmo.
 
Odp: komenda !soft (8.10)

Nie wiem co masz za silnik ale chyba jakie? g?wno za przeproszeniem skoro tobie nie dzia?aj? domy?lne skrypty z TFS'a XD
Spr?buj ten skrypt, przetestowa?em go dok?adnie i u mnie chodzi bez zarzutu (TFS 0.4), je?li tobie nie b?dzie dzia?a? to proponuje zastanowi? si? nad zmian? silnika:
[Lua]-- Repair soft boots in talkactions by Avixu
-- Dedicated for Aries 0.4.0
-- Talkactons.XML: <talkaction words="!repair" script="repair_soft_boots.lua" />

-- NAPRAWIONE PRZEZ MISZCZU #NOOB XD [PROSZE NIE USUWAC]

local config = {
repairPrice = 10000
}

function onSay(cid, words, param)
if getPlayerItemCount(cid, 6530) < 1 then
doPlayerSendCancel(cid, 'Sorry, you don\'t have a pair of worn soft boots.')
return true
end

if(not doPlayerRemoveMoney(cid, config.repairPrice)) then
doPlayerSendCancel(cid, 'Sorry, you don\'t have enough money.')
return true
end

doPlayerTakeItem(cid, 6530, 1)
doPlayerAddItem(cid, 6132, 1)
doPlayerSendTextMessage(cid, 19, 'Soft Boots repaired!')
return true
end[/Lua]
 
Odp: komenda !soft (8.10)

Ten skrypt te? przetestowa?em i dzia?a. Tylko ustawi?em na inny itemy. Musia?em mie? worn leather boots oraz 1cc ?eby naprawi? softy.
257_soft1.png


257_soft2.png


631_soft3.png

[Lua]-- Repair soft boots in talkactions by Avixu
-- Dedicated for Aries 0.4.0
-- Talkactons.XML: <talkaction words="!repair" script="repair_soft_boots.lua" />

-- NAPRAWIONE PRZEZ MISZCZU #NOOB XD [PROSZE NIE USUWAC]

local config = {
repairPrice = 10000
}

function onSay(cid, words, param)
if getPlayerItemCount(cid, 6530) >= 1 then
if(getPlayerMoney(cid) >= config.repairPrice) then
doPlayerRemoveMoney(cid,config.repairPrice)
doPlayerRemoveItem(cid, 6530, 1)
doPlayerAddItem(cid, 6132, 1)
doPlayerSendTextMessage(cid, 19, 'Soft Boots repaired!')
return true
else
doPlayerSendCancel(cid, 'Sorry, you don\'t have enough money.')
return true
end
else
doPlayerSendCancel(cid, 'Sorry, you don\'t have a pair of worn soft boots.')
return true
end
end[/Lua]
 
Odp: komenda !soft (8.10)

Tak, ale ty pewne testujesz to na 8.60 a ja chce, aby dzia?a?o na 8.10 (XML)
u mnie chyba nie ma getPlayerMoney, albo nazywa si? to inaczej. Bo ten ostatni kod nie dzia?a, bo wyskakuje b??d z "getPlayerMoney".
 
Ostatnia edycja:
Odp: komenda !soft (8.10)

Tylko, ?e w przypadku tego skryptu nie ma znaczenia jaki protok??, jaki typ silnika (SQL/XML), bo ten skrypt to nic wymagaj?cego, par? if?w, troch? funkcji lua i jaka? lipna tablica. To powinno dzia?a? na kalkulatorze.
Masz jak?? list? funkcji tego silnika? Bo nie wydaje mi si? ?eby to by? jaki? prawdziwy "alba?ski XD" silnik tylko jaki? podrabianiec.

#edit
Zapomnia?em dopisa?, ?e ja to testuje na 7.6, a nie 8.6 XD Taki zonk :]
 
Ostatnia edycja:
Odp: komenda !soft (8.10)

Do tego silnika nie ma raczej czego? takiego xd.
 
Odp: komenda !soft (8.10)

To wstaw mi tutaj zawarto?? pliku luascript.cpp oraz (jak masz) 100-shortcut.lua, 050-function.lua.
 
Odp: komenda !soft (8.10)

Kod:
local koszt = 1 -- koszt w cc
function onSay(cid, words, param)
	if getPlayerItem(cid, 6530) < 1 then
		if(getPlayerItem(cid, 2160) >= koszt) then
			doPlayerRemoveItem(cid, 2160, koszt)
			doPlayerRemoveItem(cid, 6530, 1)
			doPlayerAddItem(cid, 6132, 1)
			doPlayerSendTextMessage(cid, 22, "Soft Boots repaired!")
		else
			doPlayerSendCancel(cid, "Sorry, you don\'t have enough money.")
		end
		doPlayerSendCancel(cid, "Sorry, you don\'t have a pair of worn soft boots.")
	end
return true
end
 
Odp: komenda !soft (8.10)

Wrzucaj screeny z konsoli na przysz?o?? ;]
 
Odp: komenda !soft (8.10)

W tym ostatnim kodzie co wrzuci? Mariuszeek, mam b??d:
attempt to call global 'getPlayerItem' - moim zdaniem b??d ten oznacza ?e moim silniku nie ma takiej funkcji.
gdy zmieni? 'getPlayerItem'' na prawid?ow? funkcj?, czyli 'getPlayerItemCount' to wtedy nie pojawia mi si? ten b??d w konsoli.

Wcze?niej dobrze kmini?e? ten kod, ale mia? on b??d taki, ?e jak nie mia?e? pieni?dzy to naprawia?o softy za darmo.
Popatrzy?em na inne gotowe kody kt?re mia?em w Talkactions i uda?o mi si? znale?? ten b??d:

[LUA] -- Repair soft boots in talkactions by Avixu
-- Dedicated for Aries 0.4.0
-- Talkactons.XML: <talkaction words="!repair" script="repair_soft_boots.lua" />

-- NAPRAWIONE PRZEZ MISZCZU #NOOB XD [PROSZE NIE USUWAC]
-- NAST?PNIE POPRAWIONE PRZEZ ArtekXDPL

local config = {
repairPrice = 10000
}

function onSay(cid, words, param)
if getPlayerItemCount(cid, 6530) >= 1 then
if(doPlayerRemoveMoney(cid, config.repairPrice)) == TRUE then
doPlayerRemoveItem(cid, 6530, 1)
doPlayerAddItem(cid, 6132, 1)
doPlayerSendTextMessage(cid, 19, 'Soft Boots repaired!')
return true
else
doPlayerSendCancel(cid, 'Sorry, you don\'t have enough money.')
return true
end
else
doPlayerSendCancel(cid, 'Sorry, you don\'t have a pair of worn soft boots.')
return true
end
end[/LUA]

Aby naprawi? ten b??d trzaby?o zmieni? linijk?:
Kod:
if(doPlayerRemoveMoney(cid, config.repairPrice)) then
na:
Kod:
if(doPlayerRemoveMoney(cid, config.repairPrice)) == TRUE then
 
Ostatnia edycja:
Status
Zamknięty.
Back
Do góry