Raised This Month: $ Target: $400
 0% 

[REQ] If the player commits suicide...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 02-16-2010 , 17:44   Re: [REQ] If the player commits suicide...
Reply With Quote #1

Quote:
Originally Posted by hleV View Post
wrecked_, your code is useless.
LOL, I had meant to copy paste code from n++ but it just copy pasted PLUGIN_HANDLED. My bad.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 02-16-2010 , 20:41   Re: [REQ] If the player commits suicide...
Reply With Quote #2

Isn't that what I did?
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
T-z3P
Senior Member
Join Date: Apr 2008
Location: Iasi, Romania
Old 02-17-2010 , 06:25   Re: [REQ] If the player commits suicide...
Reply With Quote #3

You have a tipo "set_user_deatsh" .Testing now .

LE :
Code:
error 017: undefined symbol "set_user_deaths"
__________________



Last edited by T-z3P; 02-17-2010 at 06:27.
T-z3P is offline
Send a message via Yahoo to T-z3P Send a message via Skype™ to T-z3P
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 02-17-2010 , 07:15   Re: [REQ] If the player commits suicide...
Reply With Quote #4

cs_set_user_deaths
Seta00 is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 02-17-2010 , 07:55   Re: [REQ] If the player commits suicide...
Reply With Quote #5

try this:
PHP Code:
#include <amxmodx>
#include <fun>

new g_frags[33]

public 
plugin_init(){
    
register_plugin("No Frag Loss""1.0""Sylwester")
    
register_message(get_user_msgid("ScoreInfo"), "update_score")
}

public 
client_connect(id)
    
g_frags[id] = 0

public update_score(msg_idmsg_destmsg_entity){
    static 
idfrags
    id 
get_msg_arg_int(1)
    
frags get_msg_arg_int(2)
    if(
frags g_frags[id]){
        
set_msg_arg_int(20g_frags[id])
        
set_user_frags(idg_frags[id])
    }else
        
g_frags[id] = frags

__________________
Impossible is Nothing
Sylwester is offline
T-z3P
Senior Member
Join Date: Apr 2008
Location: Iasi, Romania
Old 02-17-2010 , 10:40   Re: [REQ] If the player commits suicide...
Reply With Quote #6

@ wrecked : I've tried your code with cs_set_user_deaths instead of set_user_deaths (thx to Seta00) and i've got this :



@ Sylwester : I've tried your code and i've got this :



I don't want my bot to be affected by the plugin .

PS : Thx all for trying to help me .
__________________


T-z3P is offline
Send a message via Yahoo to T-z3P Send a message via Skype™ to T-z3P
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 02-17-2010 , 10:58   Re: [REQ] If the player commits suicide...
Reply With Quote #7

Now it won't affect bots:
PHP Code:
#include <amxmodx>
#include <fun>

new g_frags[33]

public 
plugin_init(){
    
register_plugin("No Frag Loss""1.1""Sylwester")
    
register_message(get_user_msgid("ScoreInfo"), "update_score")
}

public 
client_connect(id)
    
g_frags[id] = 0

public update_score(msg_idmsg_destmsg_entity){
    static 
idfrags
    id 
get_msg_arg_int(1)
    if(
is_user_bot(id))
        return
    
frags get_msg_arg_int(2)
    if(
frags g_frags[id]){
        
set_msg_arg_int(20g_frags[id])
        
set_user_frags(idg_frags[id])
    }else
        
g_frags[id] = frags

__________________
Impossible is Nothing
Sylwester is offline
T-z3P
Senior Member
Join Date: Apr 2008
Location: Iasi, Romania
Old 02-17-2010 , 14:50   Re: [REQ] If the player commits suicide...
Reply With Quote #8

It's ok with that "bot" thing , but it's still not working ... :

__________________


T-z3P is offline
Send a message via Yahoo to T-z3P Send a message via Skype™ to T-z3P
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 02-17-2010 , 15:37   Re: [REQ] If the player commits suicide...
Reply With Quote #9

Sorry, I only read your first post about blocking -1 frags.

If you want to only block situation where you get -1 frag and +1 death, then this should work:
PHP Code:
#include <amxmodx>
#include <fun>
#include <cstrike>

new g_frags[33]
new 
g_deaths[33]

public 
plugin_init(){
    
register_plugin("No Frag Loss""1.2""Sylwester")
    
register_message(get_user_msgid("ScoreInfo"), "update_score")
}

public 
client_connect(id){
    
g_frags[id] = 0
    g_deaths
[id] = 0
}

public 
update_score(msg_idmsg_destmsg_entity){
    static 
idfragsdeaths
    id 
get_msg_arg_int(1)
    
frags get_msg_arg_int(2)
    
deaths get_msg_arg_int(3)
    if(
g_frags[id]==frags+&& g_deaths[id]==deaths-1){
        
set_msg_arg_int(20g_frags[id])
        
set_msg_arg_int(30g_deaths[id])
        
set_user_frags(idg_frags[id])
        
cs_set_user_deaths(idg_deaths[id])
    }else{
        
g_frags[id] = frags
        g_deaths
[id] = deaths
    
}

__________________
Impossible is Nothing

Last edited by Sylwester; 02-17-2010 at 15:43.
Sylwester is offline
T-z3P
Senior Member
Join Date: Apr 2008
Location: Iasi, Romania
Old 02-17-2010 , 16:40   Re: [REQ] If the player commits suicide...
Reply With Quote #10

Still not working ........ :

__________________


T-z3P is offline
Send a message via Yahoo to T-z3P Send a message via Skype™ to T-z3P
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 00:18.


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