• 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!

RevScripts Possible ? Dissable Hotkeys in area x/y/z

Lbtg

Intermediate OT User
Joined
Nov 22, 2008
Messages
2,297
Reaction score
127
Hey, does its possible to make if player step in area 10/10/x-20/20/x(x- all flooors), he gets like modal window with information 'your hotkeys is dissabled here, use your own hand'
So if player step in area, he cannot anymore like shoot sds or use rope with hotkeys, only possible to use spells. if player leave area, hotkeys comes back working.
Or in other way, player step in tile id/ or teleport, and hes hotkeys gets dissabled for lets say 60 minutes , storage with 60 min timer.
Or like if player step or go in tp, same with hotkeys dissabled, and till he walk into another tile/tp then hes hotkeys comes alive back.
Possible?
Worth idea to make it live ? what you think :)

Sorry for my pro english xd


1.5 tfs + otcv8
 
Easy way: set storage in lua and block in sources


Inside (isHotkey) condition, add the following:

C++:
int32_t blockHotkeys = 0;
player->getStorageValue(5000, blockHotkeys);

if (blockHotkeys == 1) {
    player->sendTextMessage(MESSAGE_INFO_DESCR, "You cannot use hotkeys in this area.");
    return false;
}

Edit: by timer use this conditional
C++:
(int64_t)(blockHotkeys * 1000) > OTSYS_TIME()
 
Last edited:
Easy way: set storage in lua and block in sources


Inside (isHotkey) condition, add the following:

C++:
int32_t blockHotkeys = 0;
player->getStorageValue(5000, blockHotkeys);

if (blockHotkeys == 1) {
    player->sendTextMessage(MESSAGE_INFO_DESCR, "You cannot use hotkeys in this area.");
    return false;
}

Edit: by timer use this conditional
C++:
(int64_t)(blockHotkeys * 1000) > OTSYS_TIME()
Hey bro, if i want to disable hotkeys forever, just change to or something like?

Code:
if (hotkeys) {
return RETURNVALUE_CANNOTUSETHISOBJECT;
}
 
If you only want to disable runes / potions, better to set false on hotkeyAimbotEnabled (config value)
 
If you only want to disable runes / potions, better to set false on hotkeyAimbotEnabled (config value)
I remember seeing a player use mana fluid quickly with the ot client, and I'm not mistaken, I already had this setting activated or am I crazy? anyway, thanks, i'll test it later, since i don't have ot client right now.
 
xD If you want to be completely sure;

Change
C++:
if (isHotkey) {
    uint16_t subType = item->getSubType();
    showUseHotkeyMessage(player, item, player->getItemTypeCount(item->getID(), subType != item->getItemCount() ? subType : -1));
}

To
C++:
if (isHotkey) {
    player->sendCancelMessage(RETURNVALUE_CANNOTUSETHISOBJECT);
    return false;
}
 
Easy way: set storage in lua and block in sources


Inside (isHotkey) condition, add the following:

C++:
int32_t blockHotkeys = 0;
player->getStorageValue(5000, blockHotkeys);

if (blockHotkeys == 1) {
    player->sendTextMessage(MESSAGE_INFO_DESCR, "You cannot use hotkeys in this area.");
    return false;
}

Edit: by timer use this conditional
C++:
(int64_t)(blockHotkeys * 1000) > OTSYS_TIME()
Thanks, will check this out :))))

I see someone else liked the idea :D
 
Back
Top