Hello everyone,
ive created a function that you can check if player (login for example) first time "for some time".
So, here is the code:
And here is an example:
Not tested
ive created a function that you can check if player (login for example) first time "for some time".
So, here is the code:
Lua:
function checkFirstByTime(cid,storage,value,year,month,day,times)
local funcDate = day.." "..month.." "..times.." "..year
if getPlayerStorageValue(cid, storage) ~= value then
if funcDate < os.date("%d %b %X %Y", os.time()) then
setPlayerStorageValue(cid, storage, value)
return true
end
end
return false
end
And here is an example:
Lua:
function onLogin(cid)
if checkFirstByTime(cid,6546,1,2013,Apr,30,21:30:00) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Hello, you have login for the first time durning the event! You have recived an dildo and a bucket!")
doPlayerAddItem(cid, dildo)
doPlayerAddItem(cid, bucket)
end
return true
end
Not tested