• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

C++ Help ~ doItemSetAttribute (SPEED)

loreal

Member
Joined
Oct 1, 2014
Messages
59
Reaction score
8
would like to know how do i create the doItemSetAttribute (cid, 'speed', VALUE) could someone help?

I thought something ..

item.cpp
Code:
case ATTR_SPEED:
        {
            int32_t speed;
            if(!propStream.getLong((uint32_t&)speed))
                return ATTR_READ_ERROR;

            setAttribute("speed", speed);
            break;
        }

item.h
Code:
int32_t getSpeed() const;

ATTR_SPEED = 43

more did not work.. anyone could of any hint or solution?

in the formula I thought something like: player-> setSpeed (player-> getSpeed () - player-> getBaseSpeed () + varSpeed);


i use OTX Server 3 - Based on TFS 1.2 8.60

up

up
 
Last edited by a moderator:
@loreal There is more to adding new properties to items then just defining methods and constants. My advice to you if you want to add to the server's source is to use an existing property that is similar to the one you would like to add and then record all instances of that property or references / calls to it and then make the changes (not to the existing property) but right now all you are looking at is 1 file and that's just not how source editing works.

Plus knowing a little bit of C++ couldn't hurt ;)
 
Back
Top