• 01-04.05.2026 - DOUBLE EXP / SKILL EVENT!

Talkactions !buy item_sms-shop

Status
Zamknięty.

Collocorpusek

Active User
Zarejestrowany
Dołączył
Lipiec 21, 2011
Posty
130
Liczba reakcji
23
Wiek
33
czesc,
dzis przedstawiam wam skrypta.
Po wypowiedzenie !buy nazwaitemki, kupimy wybrana rzecz z sms shopa za dana ilosc punktow.

talkactions.xml:
Kod:
	<talkaction log="yes" words="!buy" event="script" value="buyi.lua"/>

data/talkactions/scripts/buyi.lua
PHP:
function onSay(cid, words, param, channel)
if(not checkExhausted(cid, 917, 3)) then
	return true
end

local items = {
			  ["king boots"] = {ide = 2644, points = 300, count = 1},
			  ["yalahari mask"] = {ide = 9778, points = 100, count = 1},
			  ["dark lord's cape"] = {ide = 8865, points = 100, count = 1},
			  ["robe of the underworld"] = {ide = 8890, points = 100, count = 1},
			  ["bast skirt"] = {ide = 3983, points = 100, count = 1},
			  ["firewalker boots"] = {ide = 9933, points = 100, count = 1},
			  ["star wand"] = {ide = 7735, points = 100, count = 1},
			  ["soft boots"] = {ide = 2640, points = 50, count = 1},
			  ["addon doll"] = {ide = 9693, points = 150, count = 1},
			  ["skull remover"] = {ide = 8306, points = 100, count = 1},
			  ["dragon scale helmet"] = {ide = 2506, points = 100, count = 1},
			  ["master archer's armor"] = {ide = 8888, points = 100, count = 1},
			  ["yalahari leg piece"] = {ide = 9777, points = 100, count = 1},
			  ["chain bolter"] = {ide = 8850, points = 100, count = 1},
			  ["infernal bolt"] = {ide = 6529, points = 50, count = 1},
			  ["necromancer shield"] = {ide = 6433, points = 100, count = 1},
			  ["spellbook of lost souls"] = {ide = 8903, points = 100, count = 1},
			  ["horned helmet"] = {ide = 2496, points = 100, count = 1},
			  ["yalahari armor"] = {ide = 9776, points = 100, count = 1},
			  ["dragon scale legs"] = {ide = 2469, points = 100, count = 1},
			  ["nightmare shield"] = {ide = 6391, points = 100, count = 1},
			  ["jade hammer"] = {ide = 7422, points = 100, count = 1},
			  ["magic longsword"] = {ide = 2390, points = 100, count = 1},
			  ["stamina"] = {ide = 7722, points = 100, count = 1},
			  ["zaoan helmet"] = {ide = 11296, points = 150, count = 1},
			  ["zaoan armor"] = {ide = 11295, points = 150, count = 1},
			  ["zaoan legs"] = {ide = 11298, points = 150, count = 1},
			  ["Flawless ice crystal"] = {ide = 8300, points = 150, count = 1},
			  ["koshei's ancient amulet"] = {ide = 8266, points = 160, count = 1},
			  ["King Boots"] = {ide = 2644, points = 300, count = 1},
			  ["solar axe"] = {ide = 8925, points = 100, count = 1}
			  }

if (param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Write item name!\neg. !buy solar axe.")
		return true
	end

 local query = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = " ..getPlayerAccountId(cid).. " LIMIT 1") 
 local item = query:getDataInt("premium_points") 
	if item >= items[param].points then
	doPlayerAddItem(cid, items[param].ide, items[param].count)
	doSendMagicEffect(getPlayerPosition(cid), 27)
	db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` - "..items[param].points.. " WHERE `id` = " ..getPlayerAccountId(cid).. ";")
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You buy " ..items[param].count.. " " ..getItemNameById(items[param].ide).. " for " ..items[param].points.. " points!")
	else
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't have " ..items[param].points.. " points to buy " ..items[param].count.. " " ..getItemNameById(items[param].ide).."!")
	doSendMagicEffect(getPlayerPosition(cid), 2)
end
end
 
Odp: !buy item_sms-shop

Dzi?ks fajny skrypcik 9/10 bo nie testowa?em jeszcze ale m?g? by? wyt?umaczy? dla zielonych o co chodzi.
 
Status
Zamknięty.
Back
Do góry