Raised This Month: $ Target: $400
 0% 

DEATHS ZOMG


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
--kml--
Senior Member
Join Date: Jan 2009
Old 05-25-2009 , 10:01   DEATHS ZOMG
Reply With Quote #1

DEATHS ZOMG


lol
in half life i cannot change the player's deaths o.o
are there anyway to change the player deaths?
set_user_deaths doesnt works



__________________
wooT now is asking season
will ask you plenty of things for learning

Last edited by --kml--; 05-25-2009 at 10:24.
--kml-- is offline
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 05-25-2009 , 10:15   Re: DEATHS ZOMG
Reply With Quote #2

set_user_deaths() is deprecated...
Spunky is offline
Send a message via AIM to Spunky
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-25-2009 , 10:19   Re: DEATHS ZOMG
Reply With Quote #3

For CS:
PHP Code:
#define OFFSET_CSDEATHS        444
#define fm_set_user_deaths(%1,%2) set_pdata_int(%1,OFFSET_CSDEATHS ,%2) 
You will then need to update scoreboard manually with this method:

PHP Code:
message_begin(MSG_ALL g_MsgScoreInfo );
write_byte(id);
write_short(iFrags);
write_short(iDeaths);
write_short(0);
write_short(iTeam);
message_end(); 
__________________
Bugsy is offline
--kml--
Senior Member
Join Date: Jan 2009
Old 05-25-2009 , 10:22   Re: DEATHS ZOMG
Reply With Quote #4

how to use it?

PHP Code:
message_begin(MSG_ALL g_MsgScoreInfo );
write_byte(id);
write_short(iFrags);
write_short(iDeaths);
write_short(0);
write_short(iTeam);
message_end(); 
and also
@spunky
wat is deprecated LOL
im not good in english xD



__________________
wooT now is asking season
will ask you plenty of things for learning
--kml-- is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-25-2009 , 10:32   Re: DEATHS ZOMG
Reply With Quote #5

If you want to combine it into one function, use the below. If you just want deaths, you can figure it out (I hope).

PHP Code:
SetScoreid 15 );
SetScoreid 10 ); 
PHP Code:
//Global
#define OFFSET_CSDEATHS        444

new g_MsgScoreInfo;

//plugin_init()
g_MsgScoreInfo get_user_msgid"ScoreInfo" );

public 
SetScoreid iFrags iDeaths 
{
    if( !
is_user_connectedid ) )
        return;
        
    
set_pevid pev_frags floatiFrags ) );
    
set_pdata_intid OFFSET_CSDEATHS iDeaths );

    
message_beginMSG_ALL g_MsgScoreInfo );
    
write_byteid );
    
write_shortiFrags );
    
write_shortiDeaths );
    
write_short);
    
write_shortget_user_teamid ) ) ;
    
message_end();

__________________

Last edited by Bugsy; 05-25-2009 at 10:35.
Bugsy is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-25-2009 , 10:35   Re: DEATHS ZOMG
Reply With Quote #6

Use the offset m_iDeaths ( 377 ) for HL.

Try this stock :

Code:
stock hl_set_user_deaths( const player, const deaths ) {     const m_iDeaths = 377;     static msgidScoreInfo;         if ( msgidScoreInfo || ( msgidScoreInfo = get_user_msgid( "ScoreInfo" ) ) )     {         set_pdata_int( player, m_iDeaths, deaths );                 message_begin( MSG_BROADCAST, msgidScoreInfo );         write_byte( player );         write_short( get_user_frags( player ) );         write_short( deaths );         write_short( 0 );         write_short( get_user_team( player ) );         message_end();     } }

Last edited by Arkshine; 01-08-2010 at 10:48.
Arkshine is offline
--kml--
Senior Member
Join Date: Jan 2009
Old 05-29-2009 , 09:55   Re: DEATHS ZOMG
Reply With Quote #7

woooT
thx for helping
i will try 2 c if it works
P.S : why is it stock instead of public o.o
P.SS : YEs im a noob scripter

if only i can + karma
but still
i give you some crabs
__________________
wooT now is asking season
will ask you plenty of things for learning
--kml-- is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-29-2009 , 10:05   Re: DEATHS ZOMG
Reply With Quote #8

From Pawn Language Guide (which I suggest you download)

Stock Functions
A “stock” function is a function that the pawn parser must “plug into” the program
when it is used, and that it may simply “remove” from the program (without warning)
when it is not used. Stock functions allow a compiler or interpreter to optimize the
memory footprint and the file size of a (compiled) pawn program: any stock function
that is not referred to, is completely skipped —as if it were lacking from the source
file. A typical use of stock functions, hence, is in the creation of a set of “library”
functions. A collection of general purpose functions, all marked as “stock”may be put
in a separate include file, which is then included in any pawn script. Only the library
functions that are actually used get “linked” in.

To declare a stock function, prefix the function name with the keyword stock. Public
functions and native functions cannot be declared "stock".

When a stock function calls other functions, it is usually a good practice to
declare those other functions as “stock” too —with the exception of native
functions. Similarly, any global variables that are used by a stock function
should in most cases also be defined “stock”. The removal of unused (stock)
functions can cause a chain reaction in which other functions and global
variables are not longer accessed either. Those functions are then removed
as well, thereby continuing the chain reaction until only the functions that
are used, directly or indirectly, remain.

Stock Variables
A global variable may be declared as “stock”. A stock declaration is one that the parser
may remove or ignore if the variable turns out not to be used in the program.
__________________
Bugsy is offline
--kml--
Senior Member
Join Date: Jan 2009
Old 05-29-2009 , 20:42   Re: DEATHS ZOMG
Reply With Quote #9

oo
so it is removed when we compile or when we use it ?

and where is the guide xD
i want to download it
__________________
wooT now is asking season
will ask you plenty of things for learning
--kml-- is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-29-2009 , 21:51   Re: DEATHS ZOMG
Reply With Quote #10

A stock is only compiled into your plugin (.amxx) if the function\variable is used. For example, suppose you have 3 stocks in your plugin\include file: get_name(), get_id(), get_health() and in your plugin you only call get_id() out of those 3 (get_name() and get_health() are never used). get_id() is the only function that will be compiled into your amxx file. This will, as said above, improve the memory footprint and reduce the file size of your compiled .amxx file.

The guide:

http://www.compuphase.com/pawn/Pawn_Language_Guide.pdf

Other useful links:

http://www.compuphase.com/pawn/pawn.htm#DOWNLOAD_DOCS
__________________

Last edited by Bugsy; 05-29-2009 at 21:57.
Bugsy is offline
Reply



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 01:36.


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