• 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] VIP Player Broadcast

Status
Not open for further replies.

exique

Natala-ot.com
Joined
Sep 28, 2008
Messages
1,673
Reaction score
25
Location
Sweden
I've seen many broadcast scripts.. but none for VIP players!

I want a broadcast script (talkaction) like this:

Only VIP players can use it (Use VIP storage I guess)..
It costs 25 cc for each broadcast..


Reputation ofc! :thumbup:
 
Lua:
  --- Config ---
local levelReq = 100 -- Level needed to use the command.
local minChars = 3 -- How many characters may you write as minumum?
local basePrice = 50 -- Base price, will be multiplied by the players level.
local vipstorage = 1337 -- Vip storage value.

--- Exhaust Settings ---
local useExhaust = TRUE -- FALSE = Broadcast as fast as they want.
local storageValue = 1235 -- Storage for Exhaust to work.
local exhaustTime = 1 -- Minutes.
--- End config ---

function onSay(cid, words, param)
local letterPrice = basePrice + getPlayerLevel(cid) * 2
local broadcastPrice = letterPrice * string.len(param)
    if getPlayerLevel(cid) < levelReq then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Sorry, you need to be atleast level " .. levelReq .. " to use this command.")
    return TRUE
    end
    if (useExhaust == TRUE) and getPlayerStorageValue(cid, storageValue) == 1 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you need to wait before broadcasting another message.")
    return TRUE
    end
    if string.len(param) < minChars then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you need to enter atleast " .. minChars .. " characters. Each character will cost you " .. letterPrice .. " gold coins.")
    return TRUE
    end
    if doPlayerRemoveMoney(cid, broadcastPrice) == TRUE and getPlayerStorageValue(cid, vipstorage) > 0 then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Broadcast successfully sent. Your message contained " .. string.len(param) .. " characters and cost you " .. broadcastPrice .. " gold coins.")
        broadcastMessage(getPlayerName(cid) .. " [" .. getPlayerLevel(cid) .. "]: " .. param, MESSAGE_STATUS_WARNING)
        setPlayerStorageValue(cid, storageValue, 1)
        addEvent(endExhaust, exhaustTime * 60000, cid)
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you have not enough money. This message would have costed you " .. broadcastPrice .. " gold coins.")
    end
end

function endExhaust(cid)
    if (useExhaust == TRUE) then
        setPlayerStorageValue(cid, storageValue, -1)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You may now broadcast another message.")
    end
end

just edited http://otland.net/f81/player-broadcast-39877/
fill in the correct storage in the config:)
 
ThreadClosed400.jpg
 
Status
Not open for further replies.
Back
Top