How to get player affiliation?
-
In Console, I thought I used a function to get the name directly, but no, it returns the id and I used Freelancer’s function to read the string. It’s at 4347E0:
typedef UINT (*TGetString)( LPVOID, // resource table? UINT, // resource number LPWSTR, // buffer for string UINT // length of buffer (chars, not bytes) ); extern TGetString GetString; #define RSRC *(LPVOID*)0x67eca8 // the resource table // Make use of Freelancer's string buffer. LPWSTR const wstrbuf = (LPWSTR)0x66dc60; PUINT const wstrlen = (PUINT)0x6119f8; UINT strid; pub::Reputation::GetShortGroupName( fac, strid ); GetString( RSRC, strid, wstrbuf, *wstrlen );
-
Of course, you’re running the server, not the client. The function in FLServer.exe is at 4176B0. Same parameters, but RSRC is just 0/NULL. BTW, it returns the length of the string (0 if doesn’t exist; length of buffer minus one if too long). Buffer may be NULL, in which case it just finds the length.
-
Brrrr, problem is to found player affilation of player who destroyed dockable base, i mean…:
[player]
…
house = 0, fc_maquis_grp
house = -0.3, fc_corse_grp
house = -0.3, fc_brigands_grp
…
rep_group = fc_freelancer ; <-- this string
…for example to show in event mode:
basedestroy basename=Li01_08_Base basehash=3197728322 solarhash=2810150415 by=Poupkine with affilation=fc_freelancer
So at server side function to get affilation gives always 0?
-
I mean that from how FL works internally, players never have an affiliation. Of course they can have a rep-group, but they wont have an affiliation as regards the reputation methods and so on (-> get-affiliation always returning 0). Correct me if Im wrong.
-
w0dk4 wrote:
Ah, good to know!yes very… i always thought it was set via the NewCharacter.ini & linked into “co_ic_grp” & its reputations in empathy.ini
so… that’s SP only im reading here? For MP its set differently… especially when hook is involved. im very intrigued…
-
And how to get tsNick to be printed?
TString<16> tsNick; Reputation::get_nickname(tsNick, iAff);