Sign in to follow this  
Viking

setStance

Recommended Posts

Hey guys,

 

I have downgraded cod4x to the version from may 2017, because it has (nearly) all the features i need and is running stable.

However, there is one little feature that is missing and that's why I am asking here for a pluign.

 

<player> setStance("stand", "crouch" or "prone"> - which simply puts the player into the given stance ;)

 

Is there anybody who could write that plugin for me?
 

My own tries failed pretty hard because i know not really much about c

 

Thanks in advance!

 

Share this post


Link to post
Share on other sites

It's not running stable, that's why i downgraded back to the 17.5.2.

We shouldn't discuss that.

Share this post


Link to post
Share on other sites

so say whats your problem but what i know cod4x 1.8 server is more stable than 1.7 and branch new_Arch is too stable

Share this post


Link to post
Share on other sites

I am on cod4x 1.8 17.5.2. (may 2017) because the new_arch is causing problems everywhere (at least for me).

Lags, Random CI player kicks, random segmentation faults and bots not working.

 

So... can we now stop the discussion about why i am not using the latest version.

I need a plugin for 17.5.2 and it would be grea if anybody could help me.

Share this post


Link to post
Share on other sites

I think i made some progress, but i am stuck right now and hope that someone can push me into the right direction.

 

Can you tell me how to use "BG_AddPredictableEventToPlayerstate" in a plugin?

I copied it's definition:

void BG_AddPredictableEventToPlayerstate(const BGEvent EventNum_, const byte EventParam_, client_t* Client_)
{
    if (EventNum_)
    {
        const int eventIdx = Client_->ps.eventSequence & 3;
        Client_->ps.events[eventIdx] = EventNum_;
        Client_->ps.eventParms[eventIdx] = EventParam_;
        ++Client_->ps.eventSequence;
    }
}

 

but i get the following error when compiling the plugin:

In file included from playerstances.c:1:
../pinc.h:86:9: note: #pragma message: Compiling a plugin using CoD4X Plugin API. Your compiler is GCC / G++, you are using C.
 #pragma message msg
         ^~~~~~~
playerstances.c: In function ‘BG_AddPredictableEventToPlayerstate’:
playerstances.c:29:37: error: ‘client_t’ {aka ‘struct client_s’} has no member named ‘ps’
         const int eventIdx = Client_->ps.eventSequence & 3;
                                     ^~
playerstances.c:30:16: error: ‘client_t’ {aka ‘struct client_s’} has no member named ‘ps’
         Client_->ps.events[eventIdx] = EventNum_;
                ^~
playerstances.c:31:16: error: ‘client_t’ {aka ‘struct client_s’} has no member named ‘ps’
         Client_->ps.eventParms[eventIdx] = EventParam_;
                ^~
playerstances.c:32:18: error: ‘client_t’ {aka ‘struct client_s’} has no member named ‘ps’
         ++Client_->ps.eventSequence;
                  ^~

 

 

From what i have found in the cod4x sourcrs is ps standing for playerstate.

But how can i fix this error?

Share this post


Link to post
Share on other sites
Posted (edited)

Okay i think the problem is that i am using client_t* instead of gclient_t*

Can you tell me how i can use gclient_t* in plugins?
 

error: unknown type name ‘gclient_t’; did you mean ‘client_t’?

 

edit:

forgot to define the variable, so now i can compile without errors.

with a debug message i print the client name - so it's executing for the correct client.

but somehow the stance does not change.

 

The stuff in

BG_AddPredictableEventToPlayerstate

is not the place where the command is send to the player?

Edited by Viking

Share this post


Link to post
Share on other sites

i think no one helps because easiest solution to your problem is update your server and its will be possible in old arch server what you using is this not possible 

Share this post


Link to post
Share on other sites

Nvm, got it working.

Don't ask me how, all I changed was moving the type definitions from .c to a separate .h file.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this