• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

adding talkactions to my vipsystem??

hepy

New Member
Joined
Aug 15, 2007
Messages
217
Reaction score
1
hi im using tfs 0.3.4 patch2 and this vip system http://otland.net/f82/vip-system-19426/ (by Trekes) i think its working fine but how could i add a talkaction that shows the player how much vip days it have? for example !vipcheck, and also another command for gm to check the remainings day of another player like /vip name
has someone any idea how to do this? ty!:D
 
Here is the other, but dont forget to put access on it on talkactions.xml

Not Tested!

LUA:
-- script by zonet (Not Tested) put so only gamemasters can use in talkaction.xml
-- modified by nahruto :)
function onSay(cid, words, param)
	if words == "!checkvip" or words == "/checkvip" then
		if #param == 0 then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must enter a character name")
		else
			local player = getPlayerByName(param)
			if player then
				local checkV = ""..param.." have "..getPlayerPremiumDays(param).." vip days left."
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, checkV)
			else
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "A player with this name doesn\'nt exist or is offline")
			end
		end
	end
	return TRUE
end
 
Last edited:
This gets the premium days getPlayerPremiumDays(cid)

Like a script if you walk on a tile

getPlayerPremiumDays(cid)
and then u can make like doCreatureSay(cid, "You have "..getPlayerPremiumDays(cid..".", TALKTYPE_ORANGE_1)

Dont ask, this is your request just use :)
 
never tried doing this
but try

LUA:
  function onSay(cid, words, param)
local sendMsg = "You have "..getPlayerStorageValue(cid,11551).." days of vip left"
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, sendMsg)
        return TRUE
end

if work I'll make the other.
 
Here it is. I have used PopupFYI, but you can use:
LUA:
doPlayerSendTextMessage(cid, 19, getPlayerName(player) .." has " .. storage .. " days of VIP.")
aswell instead of doPlayerPopupFYI.
LUA:
function onSay(cid, words, param, channel)
local player = getPlayerByName(param)
local storage = getPlayerStorageValue(player, 11551)
local text = "".. getPlayerName(player) .." has " .. storage .. " days of VIP."
	if(param ~= "")then
		if playerExists(player) then
			doPlayerPopupFYI(cid, text)
		else
			doPlayerSendCancel(cid, "Player does not exist.")
		end
	else
		doPlayerSendCancel(cid, "Command requires param.")
	end
return TRUE
end
 
ty! rep++ for both
thank u for all ur time and help =)!

but now.. how could be the script if i need to check if the player is vip or not??
for example to cast a command
if the player have vip days he can cast the command
 
Simple VIP checking.
LUA:
if getPlayerStorageValue(player, 11551) > 0 then
--player is VIP
else
--player is not VIP
end
 
Back
Top