AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   fm pev_deaths? (https://forums.alliedmods.net/showthread.php?t=64851)

fxfighter 12-26-2007 05:10

fm pev_deaths?
 
i cant find pev_deaths or enything alike it in fm.
Do enyone know the real one or do i have to include
cstrike for cs_set_user_deaths?
Think you culd do it whit engfunc but dont remb how...

Alka 12-26-2007 05:13

Re: fm pev_deaths?
 
Code:

#define FM_OFFSET_CSDEATHS 444
 
set_pdata_int(index, FM_OFFSET_CSDEATHS, Num);


fxfighter 12-26-2007 05:17

Re: fm pev_deaths?
 
Nice thx man^^
i wonder why i didnt tught of that-.-

Arkshine 12-26-2007 05:28

Re: fm pev_deaths?
 
cs_set_user_death() converted to FM :

Code:
    #include <amxmodx>     #include <fakemeta>     #define OFFSET_CSDEATHS   444     #define LINUX_EXTRAOFFSET 5         new g_iMsg_ScoreInfo;             public plugin_init()     {         g_iMsg_ScoreInfo = get_user_msgid( "ScoreInfo" );     }         stock set_user_death( iPlayer, iNew_death )     {         set_pdata_int( iPlayer, OFFSET_CSDEATHS, iNew_death, LINUX_EXTRAOFFSET );                 // Update Scoreboard.         message_begin( MSG_ALL, g_iMsg_ScoreInfo );         write_byte( iPlayer );         write_short( get_user_frags( iPlayer ) );         write_short( iNew_death );         write_short(0);         write_short( get_user_team( iPlayer ) );         message_end();     }

ConnorMcLeod 12-26-2007 09:17

Re: fm pev_deaths?
 
Or :

Code:
#include <amxmodx> #include <fakemeta> #define OFFSET_TEAM             114 #define OFFSET_CSDEATHS         444 new gmsgScoreInfo public plugin_cfg() {     gmsgScoreInfo = get_user_msgid("ScoreInfo") } cs_set_user_deaths(id, newdeaths) {     new Float:frags     pev(id, pev_frags, frags)     set_pdata_int(id, OFFSET_CSDEATHS, newdeaths)     message_begin(MSG_ALL, gmsgScoreInfo)     write_byte(id)     write_short(floatround(frags))     write_short(newdeaths)     write_short(0)     write_short(get_pdata_int(id, OFFSET_TEAM))     message_end() }

Arkshine 12-26-2007 10:01

Re: fm pev_deaths?
 
You have to define an extraoffset for linux since it's not defined in the source code by default.

Also, mine is more readable. :mrgreen:

ConnorMcLeod 12-26-2007 10:27

Re: fm pev_deaths?
 
From what i can read there, it's 5 by default :

Code:

get_pdata_int ( index, offset, [ linuxdiff = 5 ] )

Arkshine 12-26-2007 10:29

Re: fm pev_deaths?
 
But it's not defined in the source code.

Code:
static cell AMX_NATIVE_CALL set_pdata_int(AMX *amx, cell *params) {     int index=params[1];     CHECK_ENTITY(index);     int iOffset=params[2];     if (iOffset <0)         return 1; #ifdef __linux__     iOffset += params[4]; #endif     int iValue=params[3];     *((int *)INDEXENT2(index)->pvPrivateData + iOffset) = iValue;     return 1; }

So, I assume that you have to add it manually. Perhaps it's a typo in the doc..

ConnorMcLeod 12-26-2007 10:35

Re: fm pev_deaths?
 
If you are right, and it seems you are, i have plugins to update :P


All times are GMT -4. The time now is 11:10.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.