• 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!

[Request]This doesnt work for me :S read please

Arrish

New Member
Joined
May 28, 2009
Messages
320
Reaction score
1
Location
Sweden
hi everyone, so i wanted a talkactions which allows you to broadcast and i searched and found this
Code:
function onSay(cid, words, param)
local money = 30000
	if param ~= nil then
		if doPlayerRemoveMoney(cid,money) == TRUE then
			doBroadcastMessage("".. getCreatureName(cid) .."[".. getPlayerLevel(cid) .."]:".. param .."",MESSAGE_STATUS_CONSOLE_RED)
		else
			doPlayerSendCancel(cid,"You don't have enough money.")
		end
	else
		doPlayerSendCancel(cid,"Param can't be nil.")
	end
	return FALSE
end

so i created a .lua named bc then i added this to talkactions.xml
<talkaction words="!bc" script="bc.lua"/>

then i try to write this !bc hello for example ,
and nothing happends , it just comes a !bc hello in normal if you know what i mean

so what iam doing wrong or missing something ?
i give rep+
 
PHP:
function onSay(cid, words, param, channel)
local money = 30000

	if(param == "") then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
		return TRUE
	end
	
	if doPlayerRemoveMoney(cid, money) == TRUE then
	    doBroadcastMessage("".. getCreatureName(cid) .."[".. getPlayerLevel(cid) .."]: ".. param .."",MESSAGE_STATUS_CONSOLE_RED) 
	else
		doPlayerSendCancel(cid,"You don't have enough money.")	
	end
	return TRUE
end
 
Last edited:
Doesnt work,
13:08 Blade [67]: !bc "hello
13:08 Blade [67]: !bc hello
13:08 Command param required.
13:08 Blade [67]: !bc

still nothing happends:s
but i get these errors
data/talkactions/scripts/bc.lua:10: attempt to call global 'doBroadcastMessage' (a nil value)
stack traceback:
data/talkactions/scripts/bc.lua:10: in function <data/talkactions/scripts/bc.lua:1>
 
Lua:
function onSay(cid, words, param, channel)
local money = 30000

    if(param == "") then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
        return TRUE
    end
    
    if doPlayerRemoveMoney(cid, money) == TRUE then
        broadcastMessage("".. getCreatureName(cid) .."[".. getPlayerLevel(cid) .."]: ".. param .."",MESSAGE_STATUS_CONSOLE_RED) 
    else
        doPlayerSendCancel(cid,"You don't have enough money.")    
    end
    return TRUE
end
 
Back
Top