Epic
Banned User
How can i make the players that have used the "Vip Medal" item, have a colored text above him saying "Vip player!" forever? Thanks
function onUse(cid, item, frompos, item2, topos)
if item.itemid == 5785 then
if getPlayerLevel(cid) > 1 then
getPlayerStorageValue(cid, 11551)
doSendAnimatedText(getPlayerPosition(cid), "Welcome!", TEXTCOLOR_RED)
doCreatureSay(cid, "CONGRATULATIONS! VIP Player! Forever!. ", TALKTYPE_ORANGE_1)
setPlayerStorageValue(cid, 11551, 1)
doRemoveItem(item.uid, 1)
else
doPlayerSendCancel(cid,'You are not a VIP.')
doRemoveItem(item.uid, 1)
end
else
end
return 1
end
Edit your Vip item.lua in actions
function onUse(cid, item, frompos, item2, topos)
if item.itemid == 5785 then
if getPlayerLevel(cid) > 1 then
getPlayerStorageValue(cid, 11551)
doSendAnimatedText(getPlayerPosition(cid), "Welcome!", TEXTCOLOR_RED)
doCreatureSay(cid, "Another Noob that have donated and can accest Vip Island :D Jk!", TALKTYPE_ORANGE_1)
setPlayerStorageValue(cid, 11551, 1)
doRemoveItem(item.uid, 1)
else
doPlayerSendCancel(cid,'You are not a donator.')
doRemoveItem(item.uid, 1)
end
else
end
return 1
end
Client-sided, I believe.
Unless you're talking about it saying "VIP Player!" when you use it, as an animation.
Otherwise, Client-Sided.
Red
-- Credits StreamSide, Empty and Kaorus
function onUse(cid, item, fromPosition, itemEx, toPosition)
local name = getCreatureName(cid)
-- if getPlayerStorageValue(cid,11551) < 1 then
if getPlayerLevel(cid) > 1 then
getPlayerStorageValue(cid, 11551)
doPlayerSetTown(cid, 16)
doSendAnimatedText(getPlayerPosition(cid), "Welcome!", TEXTCOLOR_RED)
doCreatureSay(cid, "CONGRATULATIONS! You are now a VIP for 15 days! You can now enter the VIP-area and use unique features!. ", TALKTYPE_ORANGE_1)
setPlayerStorageValue(cid, 11551, (getPlayerStorageValue(cid,11551) + [COLOR="red"][B]15)) --- vip days![/B][/COLOR]
doRemoveItem(item.uid, 1)
else
doPlayerSendCancel(cid,"You need to be at least level 2 to use this.")
doRemoveItem(item.uid, 1)
end
-- else
-- doPlayerSendCancel(cid,"You are already a donator.")
-- end
return TRUE
end
-- Credits StreamSide and Empty
function onUse(cid, item, fromPosition, itemEx, toPosition)
local cidPosition = getCreaturePosition(cid)
if (item.actionid == 11551 and getPlayerStorageValue(cid,11551) >= 1) then
if cidPosition.x < toPosition.x then
doTeleportThing(cid, {x=toPosition.x+1,y=toPosition.y,z=toPosition.z}, TRUE)
doCreatureSay(cid, "Welcome VIP Player!", TALKTYPE_ORANGE_1)
else
doTeleportThing(cid, {x=toPosition.x-1,y=toPosition.y,z=toPosition.z}, TRUE)
doCreatureSay(cid, "Welcome VIP Player!", TALKTYPE_ORANGE_1)
end
return TRUE
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but only VIP Players can pass here! Buy VIP on the WEB.")
return TRUE
end
return FALSE
end
bump!
function onUse(cid, item, frompos, item2, topos)
if item.itemid == 5785 then
if getPlayerLevel(cid) > 1 then
getPlayerStorageValue(cid, 11551)
doSendAnimatedText(getPlayerPosition(cid), "Welcome!", TEXTCOLOR_RED)
doCreatureSay(cid, "CONGRATULATIONS! You are now a VIP! You can now enter the VIP-area and use unique features!. ", TALKTYPE_ORANGE_1)
setPlayerStorageValue(cid, 11551, 1)
doRemoveItem(item.uid, 1)
else
doPlayerSendCancel(cid,'You are not a donator.')
doRemoveItem(item.uid, 1)
end
else
end
return 1
end
function onThink(cid, interval, lastExecution)
playerpos = getPlayerPosition(cid)
if getPlayerStorageValue(cid, 11551) == 1 then
doSendAnimatedText(playerpos, "Vip", math.random(1,254))
doSendMagicEffect(playerpos, math.random(12,14))
end
return TRUE
end
<event type="think" name="Vip" event="script" value="vip.lua"/>
registerCreatureEvent(cid, "Vip")