Raised This Month: $ Target: $400
 0% 

fm pev_deaths?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fxfighter
Veteran Member
Join Date: Feb 2007
Location: Trollhättan
Old 12-26-2007 , 05:10   fm pev_deaths?
Reply With Quote #1

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...
fxfighter is offline
Send a message via MSN to fxfighter
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 12-26-2007 , 05:13   Re: fm pev_deaths?
Reply With Quote #2

Code:
#define FM_OFFSET_CSDEATHS 444
 
set_pdata_int(index, FM_OFFSET_CSDEATHS, Num);
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
fxfighter
Veteran Member
Join Date: Feb 2007
Location: Trollhättan
Old 12-26-2007 , 05:17   Re: fm pev_deaths?
Reply With Quote #3

Nice thx man^^
i wonder why i didnt tught of that-.-
fxfighter is offline
Send a message via MSN to fxfighter
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-26-2007 , 05:28   Re: fm pev_deaths?
Reply With Quote #4

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();     }
__________________

Last edited by Arkshine; 12-26-2007 at 05:37.
Arkshine is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-26-2007 , 09:17   Re: fm pev_deaths?
Reply With Quote #5

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() }
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 12-26-2007 at 09:21.
ConnorMcLeod is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-26-2007 , 10:01   Re: fm pev_deaths?
Reply With Quote #6

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

Also, mine is more readable.
__________________
Arkshine is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-26-2007 , 10:27   Re: fm pev_deaths?
Reply With Quote #7

From what i can read there, it's 5 by default :

Code:
get_pdata_int ( index, offset, [ linuxdiff = 5 ] )
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-26-2007 , 10:29   Re: fm pev_deaths?
Reply With Quote #8

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..
__________________

Last edited by Arkshine; 12-26-2007 at 10:36.
Arkshine is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-26-2007 , 10:35   Re: fm pev_deaths?
Reply With Quote #9

If you are right, and it seems you are, i have plugins to update
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 12-26-2007 at 10:43.
ConnorMcLeod is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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