New item changes players speeds for movements Created 11 months ago2024-01-02 10:22:18 UTC by La Hire La Hire

Created 11 months ago2024-01-02 10:22:18 UTC by La Hire La Hire

Posted 11 months ago2024-01-02 10:22:18 UTC Post #348385
As a non-coder to my own suprise I was able to clone the longjum-item to get a new item for the player to pick up. The effects should be a changing of players speeds and heights but I dont know how to do that :-(
The relevant part of the class in items.cpp looks like this:

{
pPlayer->m_fMYITEM = true; // player now has the Item
???
MESSAGE_BEGIN(MSG_ONE, gmsgItemPickup, NULL, pPlayer->pev);
WRITE_STRING(STRING(pev->classname));
MESSAGE_END();
return true;
}

What do I need to enter for the ??? to change the cl_forwardspeed, flDuckTime etc please? I am unable to make the correct entries :-(
Posted 11 months ago2024-01-03 11:31:25 UTC Post #348392
Update: so I entered
pPlayer->pev->maxspeed = X;
and this works, but I need the ducktime, forwardspeed etc. and those dont work this way :-( Any idea what I have to do please?
Posted 11 months ago2024-01-07 10:37:38 UTC Post #348416
Nobody has an idea? :-( I saw there are some console-commands that would do the trick but it seems there is no way to make an entity (item) to trigger them. In Source there is the point_clientcommand but in Goldsource there is not. Is it possible to get this into my mod?
Posted 11 months ago2024-01-07 13:35:31 UTC Post #348419
Do ducking have it's own max speed?
Meerjel01 Meerjel01I want to be a Meerjel
Posted 11 months ago2024-01-07 21:05:05 UTC Post #348423
No, guess I have to trick in the mapping to have the user not duck. Still the forwardspeed and centering the view which are important for me can be set via console.
If I put the console-commands in an own config that is triggered with a button but dont bind the button, can it still be triggered by an Entity? It should only be set for one specific map and not manuall by the player.
You must be logged in to post a response.