Raised This Month: $ Target: $400
 0% 

[Solved]Can i Replace This Code with Another Code?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
devilicioux
Veteran Member
Join Date: Jun 2013
Location: Delhi,India
Old 06-30-2014 , 10:02   [Solved]Can i Replace This Code with Another Code?
Reply With Quote #1

I lifted this code from somewhere

PHP Code:
set_msg_block(g_msgDeathMsg,BLOCK_ONCE
    
set_msg_block(g_msgScoreInfo,BLOCK_ONCE
    
user_kill(attacked
 
    
//user_kill removes a frag, this gives it back 
    
set_user_frags(attacked,get_user_frags(attacked) + 1
Can i replace this entire portion of code with

PHP Code:
user_silentkill(attacked
?

Point of the asking this question is description from documentation ..

Quote:
user_silentkill
Engine (engine_stocks.inc) Description
user_silentkill - Kills a user without a death message.
What i want is it should NOT be considered as a suicide .. !
__________________
You keep bringing ANTICHRISTUS down .. He will rise again and kick asses !

#RespectList ANTICHRISTUS fysiks Bugsy

Most Common Errors You Can Encounter Every Now and Then

Last edited by devilicioux; 07-02-2014 at 05:17.
devilicioux is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 06-30-2014 , 17:30   Re: Can i Replace This Code with Another Code?
Reply With Quote #2

use user_silentkill(). It should not mess with frags as you mentioned.
mottzi is offline
Send a message via MSN to mottzi
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 06-30-2014 , 20:14   Re: Can i Replace This Code with Another Code?
Reply With Quote #3

Since it's a stock, you can easily open the include which contains the stock to see what it does and if that fits your need.

I found this in message_stocks.inc, don't know why yours say engine_stocks.inc.
Code:
/* Kills a user without a message. */ stock user_silentkill(index) {     static msgid = 0;     new msgblock;     if (!msgid)     {         msgid = get_user_msgid("DeathMsg");     }     msgblock = get_msg_block(msgid);     set_msg_block(msgid, BLOCK_ONCE);       user_kill(index, 1);     set_msg_block(msgid, msgblock);     return 1; }

As far as I see, it is not resetting the kills but I don't really know if user_kill() removes one.
You'll just have to try it out to make sure.

The second parameter of user_kill() prevents the score from changing.
__________________

Last edited by Black Rose; 07-01-2014 at 03:08.
Black Rose is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 06-30-2014 , 21:07   Re: Can i Replace This Code with Another Code?
Reply With Quote #4

Quote:
Originally Posted by Black Rose View Post
I found this in message_stocks.inc, don't know why yours say engine_stocks.inc.
Because he is using documentation for 1.60. message_stocks.inc wasn't created until 1.76
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).

Last edited by YamiKaitou; 06-30-2014 at 21:07.
YamiKaitou is offline
devilicioux
Veteran Member
Join Date: Jun 2013
Location: Delhi,India
Old 07-02-2014 , 05:15   Re: Can i Replace This Code with Another Code?
Reply With Quote #5

Okay so i tested up things and the solution was met using Ham_killed..
Quote:
new bool:shouldgib = true;
// Let's gib!
ExecuteHam(Ham_Killed,target,attacker,shouldgib);
Quote:
/**
* Description: Normally called whenever an entity dies.
* Forward params: function(this, idattacker, shouldgib)
* Return type: None.
* Execute params: ExecuteHam(Ham_Killed, this, idattacker, shouldgib);
*/
Ham_Killed,
__________________
You keep bringing ANTICHRISTUS down .. He will rise again and kick asses !

#RespectList ANTICHRISTUS fysiks Bugsy

Most Common Errors You Can Encounter Every Now and Then

Last edited by devilicioux; 07-02-2014 at 05:16.
devilicioux 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 21:17.


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