Raised This Month: $ Target: $400
 0% 

dead even get weapon bug......


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
0920357689
Senior Member
Join Date: Apr 2008
Old 12-05-2010 , 09:45   dead even get weapon bug......
Reply With Quote #1

PHP Code:
register_event("DeathMsg""player_death""a");
 
public 
player_death(id)
{
 new 
weapon[32];
 new 
Killer read_data(1)
 new 
Victim read_data(2
 
read_data(3weapon31)
 
 if(!
is_user_connected(Killer))
  return 
PLUGIN_CONTINUE;
 if(
player_team[Killer] == player_team[Victim])
  return 
PLUGIN_CONTINUE;
 if(
Killer == Victim)
  return 
PLUGIN_CONTINUE;
 if(
containi(weapon,"knife") == -1)
 
//if(!equal(weapon, "knife"))
 
{
  
NO KNIFE KILL WILL DO
 }
 return 
PLUGIN_CONTINUE;

if knife kill also will do....where have bug?
i can't find.......

i need if knife kill will "return PLUGIN_CONTINUE"

Last edited by 0920357689; 12-05-2010 at 09:50.
0920357689 is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 12-05-2010 , 10:12   Re: dead even get weapon bug......
Reply With Quote #2

I think it would be easier if you told us what you're trying to do.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
0920357689
Senior Member
Join Date: Apr 2008
Old 12-05-2010 , 10:31   Re: dead even get weapon bug......
Reply With Quote #3

Quote:
Originally Posted by drekes View Post
I think it would be easier if you told us what you're trying to do.
give exp to player if he doesn't use knife
0920357689 is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 12-05-2010 , 11:30   Re: dead even get weapon bug......
Reply With Quote #4

PHP Code:
 register_event("DeathMsg""Event_DeathMsg""a""1>0");
 
 public 
Event_DeathMsg()
 {
    new 
weapon[20];
    new 
Killer read_data(1);
    new 
Victim read_data(2) ;
    
read_data(4weaponcharsmax(weapon));
 
    if(
player_team[Killer] == player_team[Victim] || Killer == Victim || !(<= Victim <= 32))
        return 
PLUGIN_HANDLED;
        
    if(!
equal(weapon"knife"))
    {
        
// Player killed without knife
    
}

Try to do it like this.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
0920357689
Senior Member
Join Date: Apr 2008
Old 12-05-2010 , 11:53   Re: dead even get weapon bug......
Reply With Quote #5

ok, this is work,thank you!
0920357689 is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 12-05-2010 , 13:03   Re: dead even get weapon bug......
Reply With Quote #6

No problem.

If you ever need to read_data from an event again, you can check it here to see all the info about the events here: http://wiki.alliedmods.net/Half-Life_1_Game_Events
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 12-05-2010 , 13:14   Re: dead even get weapon bug......
Reply With Quote #7

Quote:
Originally Posted by drekes View Post
No problem.

If you ever need to read_data from an event again, you can check it here to see all the info about the events here: http://wiki.alliedmods.net/Half-Life_1_Game_Events
Regarding da code u posted above, in da death MSG event, the victim is always a player entity but the attacker can be or can not be a plyer entity so it would be better to add the check in the above code (1 <= attacker <= 32)
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 12-05-2010 , 13:21   Re: dead even get weapon bug......
Reply With Quote #8

Quote:
Originally Posted by abdul-rehman View Post
Regarding da code u posted above, in da death MSG event, the victim is always a player entity but the attacker can be or can not be a plyer entity so it would be better to add the check in the above code (1 <= attacker <= 32)
Didn't think about that victim thing.
The function is only called when attacker > 0. because i registered it with "1>0"
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
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:25.


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