Advertisement
Bitupx

securemode

Nov 1st, 2022
30
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. function onTarget(cid, target)
  2. if(attacker and isPlayer(attacker) and (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) and getPlayerSecureMode(attacker)) then
  3. return false
  4. end
  5. return true
  6. end
  7.  
  8. function onStatsChange(cid, attacker, type, combat, value)
  9. if(attacker and isPlayer(attacker) and (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) and getPlayerSecureMode(attacker)) then
  10. if combat ~= COMBAT_HEALING then
  11. return false
  12. end
  13. end
  14. return true
  15. end
  16.  
  17. function onCast(cid, target)
  18. if(attacker and isPlayer(attacker) and (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) and getPlayerSecureMode(attacker)) then
  19. if combat ~= COMBAT_HEALING then
  20. return false
  21. end
  22. end
  23. return true
  24. end
Advertisement
Comments
  • Bitupx
    2 years
    # text 0.39 KB | 0 0
    1. --talkaction
    2.  
    3. local msg = "Now your PvP system is %s."
    4. function onSay(cid, words, param)
    5. local _table = {
    6. ["on"] = {"active", 1},
    7. ["off"] = {"disabled", 0},
    8. }
    9. if _table[param:lower()] then
    10. local mode = _table[param:lower()]
    11. setPlayerStorageValue(cid, 91821, mode[2])
    12. doPlayerSendTextMessage(cid, 27, msg:format(mode[1]))
    13. end
    14. return true
    15. end
Add Comment
Please, Sign In to add comment
Advertisement