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

Lua This script will not work on 0.3.6pl1 (easy i guess)

  • Thread starter Thread starter Rozinx
  • Start date Start date
R

Rozinx

Guest
Hey peeps, this script works on my 0.3.4 servers , but not on 0.3.6 one ;x

Code:
function onSay(cid, words, param)
timenow = os.time()
quantity = math.floor((getPlayerStorageValue(cid,29000) - timenow)/(3600*24))

    local message = "[V.I.P] ".. getCreatureName(cid) .. " [" .. getPlayerLevel(cid) .. "]: " .. param
	local message2 = "[Golden V.I.P] ".. getCreatureName(cid) .. " [" .. getPlayerLevel(cid) .. "]: " .. param
    
if quantity > 0 and getPlayerStorageValue(cid,26000) < 1 then
    if getPlayerStorageValue(cid,28998) < 1 then
               
    doBroadcastMessage(cid, message, MESSAGE_EVENT_ADVANCE)

else if getPlayerStorageValue(cid,28998) == 1 then 
	doBroadcastMessage(cid, message2, MESSAGE_EVENT_ADVANCE)

else
	doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Somente jogadores VIPs podem fazer isso ou você foi bloqueado.")
end  return TRUE end return TRUE end return TRUE end

Has broadcast function been changed somewhere?
It's not tutorflags or something like that, because I can't broadcast via GOD too.
 
Hello!

Try:
LUA:
function onSay(cid, words, param)

timenow = os.time()
quantity = math.floor((getPlayerStorageValue(cid, 29000) - timenow)/(3600*24))

	local message = "[V.I.P] ".. getCreatureName(cid) .. " [" .. getPlayerLevel(cid) .. "]: " .. param
	local message2 = "[Golden V.I.P] ".. getCreatureName(cid) .. " [" .. getPlayerLevel(cid) .. "]: " .. param
    
	if quantity > 0 and getPlayerStorageValue(cid, 26000) < 1 then
		if getPlayerStorageValue(cid, 28998) < 1 then
			doPlayerBroadcastMessage(cid, message, MESSAGE_EVENT_ADVANCE)
		elseif getPlayerStorageValue(cid, 28998) == 1 then 
			doPlayerBroadcastMessage(cid, message2, MESSAGE_EVENT_ADVANCE)
		else
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Somente jogadores VIPs podem fazer isso ou você foi bloqueado.")
		end
	end

return TRUE
end
 
Any error message?

Try:
LUA:
function onSay(cid, words, param)

timenow = os.time()
quantity = math.floor((getPlayerStorageValue(cid, 29000) - timenow)/(3600*24))

        local message = "[V.I.P] ".. getCreatureName(cid) .. " [" .. getPlayerLevel(cid) .. "]: " .. param .. ""
        local message2 = "[Golden V.I.P] ".. getCreatureName(cid) .. " [" .. getPlayerLevel(cid) .. "]: " .. param .. ""
   
        if quantity > 0 and getPlayerStorageValue(cid, 26000) < 1 then
                if getPlayerStorageValue(cid, 28998) < 1 then
                        doBroadcastMessage(message, MESSAGE_EVENT_ADVANCE)
                elseif getPlayerStorageValue(cid, 28998) == 1 then
                        doBroadcastMessage(message2, MESSAGE_EVENT_ADVANCE)
                else
                        doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Somente jogadores VIPs podem fazer isso ou você foi bloqueado.")
                end
        end

return TRUE
end
 
LUA:
function onSay(cid, words, param)

        local quantity = (getPlayerStorageValue(cid, 29000) - os.time())/(3600*24)

        local message = "[V.I.P] ".. getCreatureName(cid) .. " [" .. getPlayerLevel(cid) .. "]: " .. param .. ""
        local message2 = "[Golden V.I.P] ".. getCreatureName(cid) .. " [" .. getPlayerLevel(cid) .. "]: " .. param .. ""
   
        if quantity > 0 and getPlayerStorageValue(cid, 26000) < 1 then
                if getPlayerStorageValue(cid, 28998) < 1 then
                        doBroadcastMessage(message, MESSAGE_EVENT_ADVANCE)
                elseif getPlayerStorageValue(cid, 28998) == 1 then
                        doBroadcastMessage(message2, MESSAGE_EVENT_ADVANCE)
                else
                        doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Somente jogadores VIPs podem fazer isso ou você foi bloqueado.")
                end
        else
                doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Error. (test)")
        end

return TRUE
end
Test that, if a message appear saying "Error. (test)" then the problem is that you don't have the necessary storage values.
 
Dude, I love you.
The last one has worked.
Lmfao, I have no idea why, could you explain?
I made this code on my own, but I'm still a noob scripter.

Oh, you must be very experienced, but I can see why

Code:
doBroadcastMessage(message, MESSAGE_EVENT_ADVANCE)

would never work, because players would have no flags, coz they're on players group.
 
Back
Top