Guest User

Untitled

a guest
Aug 4th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 0.83 KB | None | 0 0
  1. local exhaust = createConditionObject(CONDITION_EXHAUST)
  2. setConditionParam(exhaust, CONDITION_PARAM_TICKS, 30000)
  3. setConditionParam(exhaust, CONDITION_PARAM_SUBID, 4)
  4.  
  5. function onSay(cid, words, param, channel)
  6.     local a = getCreatureStorage(cid, 127)
  7.     if a == -1 then
  8.         return true
  9.     end
  10.  
  11.     if param == '' or tonumber(param) == nil then
  12.         doCreatureSay(cid, 'Invalid answer.', TALKTYPE_ORANGE_1, false, cid)
  13.     elseif hasCondition(cid, CONDITION_EXHAUST, 4) then
  14.         doPlayerSendCancel(cid, 'Please wait before answering again.')
  15.     elseif tonumber(param) ~= a then
  16.         doAddCondition(cid, exhaust)
  17.         doCreatureSay(cid, 'Incorrect answer.', TALKTYPE_ORANGE_1, false, cid)
  18.     else
  19.         for i = 125, 128 do
  20.             doCreatureSetStorage(cid, i)
  21.         end
  22.         doCreatureSay(cid, 'Thank you for not afking!', TALKTYPE_ORANGE_1, false, cid)
  23.     end
  24.     return true
  25. end
Add Comment
Please, Sign In to add comment