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

Need Script plix..

G!aN

New Member
Joined
May 30, 2009
Messages
57
Reaction score
0
Location
Peru
Hello need script please..

1.- Need script when buy premium on website (buypoints.php) automaticly promoted players.

Anyone help me please..
 
Last edited:
Lua:
function onThink(cid)
for _, cid in ipairs(getPlayersOnline()) do
     if isPremium(cid) and getPlayerPromotionLevel(cid) < 1  then
             setPlayerPromotionLevel(cid,1)
     else
            if getPlayerPromotionLevel(cid) > 0 then
                    setPlayerPromotionLevel(cid,0)
            end
     end
end
return true
end

in creatureevent.xml add this
Code:
<event type="think" name="t" event="script" value="xxxx.lua"/>

in creatureevent-->scripts-->login.lua
[before last return true in script]
Code:
registerCreatureEvent(cid, "t")
 
Lua:
local cfg = {
	newtownid = 1
	}
function onThink(cid)
for _, cid in ipairs(getPlayersOnline()) do
local queststatus = getPlayerStorageValue(cid,2333)
if queststatus == -1
     if isPremium(cid) == false and getPlayerPromotionLevel(cid) >= 1 then
			 doPlayerSetTown(cid, cfg.newtownid)
                         setPlayerPromotionLevel(cid,0)
			 doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))
                         setPlayerStorageValue(cid,2333,1)
     end
end
end
return true
end
Rep+
 
lol, i think if you remove storage, it will not spam as you already checkes if he is promoted...... take a better look

Lua:
local cfg = {
	newtownid = 1
	}
function onThink(cid)
for _, cid in ipairs(getPlayersOnline()) do

     if isPremium(cid) == false and getPlayerPromotionLevel(cid) >= 1 then
			setPlayerPromotionLevel(cid,0)
                       doPlayerSetTown(cid, cfg.newtownid)
                         doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))
                         setPlayerStorageValue(cid,2333,1)
     end
end
return true
end
 
No, it checks if player doesn't have premium and if it's false then it teleports him to temple and sets that new townid, no matter if it has just done that 2 minutes ago <_<
up, btw it still has setplayerstoragevalue.

This script needs more lines to premium script too (setplayerstoragevalue(cid, XXXX, -1))
then it will work.
 
True..
Lua:
local cfg = {
	newtownid = 1
	}
function onThink(cid)
for _, cid in ipairs(getPlayersOnline()) do
local queststatus = getPlayerStorageValue(cid,2333)

     if (not isPremium(cid)) and queststatus == 1 then
	        doPlayerSetTown(cid, cfg.newtownid)
            setPlayerPromotionLevel(cid,0)
			doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))
            setPlayerStorageValue(cid,2333,-1)
     end
	 if isPremium(cid) and queststatus < 1 then
	      setPlayerStorageValue(cid,2333,1)
	 end
end
return true
end

I think this will work
 
Use this script then
Lua:
function onSay(cid, words, param)
    if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
        doPlayerSendCancel(cid,'You have already got one or more blessings!')
    else
        if doPlayerRemoveMoney(cid, 60000) == TRUE then
            doPlayerAddBlessing(cid, 1)
            doPlayerAddBlessing(cid, 2)
            doPlayerAddBlessing(cid, 3)
            doPlayerAddBlessing(cid, 4)
            doPlayerAddBlessing(cid, 5)
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
        else
            doPlayerSendCancel(cid, "You need 6 crystal coin to get blessed!")
        end
    end    
    return 1
end
 
Back
Top