• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

talkaction additem comand

Triggah

TrigCore
Joined
Aug 1, 2007
Messages
436
Reaction score
2
how would i do a command that if player has certain storage value -1, then (!commandname), doplayeradditem (itemid)
else
you did not donate for this item.

also: if used once, cant use again until relog.

anyone know how i would do that?
 
Code:
local function isDonator(cid)
	return getPlayerStorageValue(cid, 12345) == -1 and false or true
end

function onSay(cid, words, param, channel)
	if isDonator(cid) then
		if (getPlayerStorageValue(cid, 54321) == -1) then
			doPlayerAddItem(cid, 1234, 100)
			setPlayerStorageValue(cid, 54321, 1)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_ADVANCE, "Item purchased!")
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_ADVANCE, "You have already bought this item, please re-log for next!")
		end
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_ADVANCE, "You did not donate for this item!")
	end
	return true
end

Code:
function onLogout(cid)
	setPlayerStorageValue(cid, 54321, -1)
	return true
end
 
not exactly what i wanted, but close to it, as for the onlogout function, where would u place that?

how would i make this a talkaction?

like if i type
!donationrod
 
Last edited:
Back
Top