Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
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!
Hi guys, I tried to do a script that whenever a play uses a certain item, the item will be removed and he will be able to send a broadcast message just like a GM.
Can someone help me out with that script? Thanks a lot!
What did you had in mind about how people should write their message?
You can do something like this, use a writeable item and then people can write their message on this item, then it will broadcast this message and the item will be removed.
function onTextEdit(cid, item, newText)
if item.itemid == 1951 then
doBroadcastMessage(getPlayerName(cid)..": "..newText)
doRemoveItem(item.uid, 1)
end
return true
end
function onUse should have () (every function should have that) and add the parameters incase people need them.
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
The function doRemoveItem works with uid, so you can use item.uid to remove the item people use, or to remove an item from a player: doPlayerRemoveItem(cid, itemid, count)
For the broadcast function use the message types that start with MESSAGE_, like with doPlayerSendTextMessage.
And you forgot return true (above end).