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

C++ [TFS 1.3] Add a storagevalue in weapons.cpp

aqubjukr

Well-Known Member
Joined
Mar 13, 2013
Messages
200
Solutions
17
Reaction score
79
Location
Paraná, Brazil
I'm trying to set a storagevalue to cancel the removecount for as long as the player has storage, but i didn't got.


Interval to be modifie:
C++:
case WEAPONACTION_REMOVECOUNT:
            if (g_config.getBoolean(ConfigManager::REMOVE_WEAPON_AMMO)) {
                Weapon::decrementItemCount(item);
            }

Complete SRC: Src

One of my failed attempts:
C++:
        case WEAPONACTION_REMOVECOUNT:
            if (g_config.getBoolean(ConfigManager::REMOVE_WEAPON_AMMO)) {
                Weapon::decrementItemCount(item);
                player->updateSupplyTracker(item);
            } else if (
                int32_t value;
                player->getStorageValue(555845, value)){
                return false;
            }

I believe it is not very difficult, but I have no experience in dealing with sources. 🙃
 
Here @oen432 explained everything:

Please use Search Button in OTLand or Google ("no remove ammo if player storage otland") before posting next thread.
Always try to search first :)
Have a nice day!
 
Here @oen432 explained everything:

Please use Search Button in OTLand or Google before posting next thread.
Always try to search first :)
Have a nice day!
Same guy asking btw
 
I have this doubt when to getstoragevalue, because I managed to do it only using the target "training monk" and I want to use it for events too.

Would it be correct to revive the topic?
 
I have this doubt when to getstoragevalue, because I managed to do it only using the target "training monk" and I want to use it for events too.

Would it be correct to revive the topic?
You have to explain this better, what kind of events?
 
It's only for a the last man standing game.
The player who enter in teleport got storage (555845,1) to do some functions and when he die, logout or leave from event he loose the storage.
I just want to don't remove the ammo if player get this storage.

After, i'll try do changes in potion waste too.
 
you can do it buy adding 1 ammo each time the script runs, takes 1 ammo so player:addItem(AMMOID, 1) can be 50% of the script lol
 
you can do it buy adding 1 ammo each time the script runs, takes 1 ammo so player:addItem(AMMOID, 1) can be 50% of the script lol
Less efficient.
1. Check if distance weapon is throwing weapon or ammo weapon
2. Get ammo item
3. Check if storage or something
4. Add item
 
Back
Top