• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Only 2 times use on talkaction

DestinationSer

@echo off
Joined
Mar 7, 2009
Messages
2,806
Solutions
1
Reaction score
676
Code:
local items = { -- count only work on stackable items ex: gold,food, etc..
				[1] = {id = 2410, count = 1},  
				[2] = {id = 9811, count = 1},  
				[3] = {id = 9808, count = 1},  
				[4] = {id = 9821, count = 1},  
				[5] = {id = 9814, count = 1},  
				[6] = {id = 9817, count = 1},  
				[7] = {id = 2456, count = 1}, 
				[8] = {id = 2182, count = 1}, 
				[9] = {id = 2384, count = 1}, 
				[10] = {id = 2262 , count = 1}  
}				
local bpId = 1988 -- bp id
function onSay(cid, words, param, channel)
	local bp= doPlayerAddItem(cid,bpId)
	for _,item in ipairs(items) do 
		doAddContainerItem(bp, item.id, item.count)
	end
	return true
end
I want this to be only 2 times use each account
Answer fast. thanks
 
first add this function:
http://otland.net/f163/hasaccountstorage-cid-key-value-148522/#post1428068
LUA:
local items = { -- count only work on stackable items ex: gold,food, etc..
				[1] = {id = 2410, count = 1},  
				[2] = {id = 9811, count = 1},  
				[3] = {id = 9808, count = 1},  
				[4] = {id = 9821, count = 1},  
				[5] = {id = 9814, count = 1},  
				[6] = {id = 9817, count = 1},  
				[7] = {id = 2456, count = 1}, 
				[8] = {id = 2182, count = 1}, 
				[9] = {id = 2384, count = 1}, 
				[10] = {id = 2262 , count = 1}  
}				
local bpId = 1988 -- bp id
local storage = 23543 
local counter = 2
function onSay(cid, words, param, channel)

	if (hasAccountStorage(cid, storage, counter)) then
		return false
	end
	st = getPlayerStorageValue(cid, storage) 
	doPlayerSetStorageValue(cid, storage, st > 0 and st + 1 or st +2)
	local bp= doPlayerAddItem(cid,bpId)
	for _,item in ipairs(items) do 
		doAddContainerItem(bp, item.id, item.count)
	end
	return true
end
 
Back
Top