AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] New Knifeitup Code Not Working :( (https://forums.alliedmods.net/showthread.php?t=252932)

priyojit 12-11-2014 22:29

[HELP] New Knifeitup Code Not Working :(
 
PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <dhudmessage>  

#define PLUGIN "knifeitup"
#define VERSION "2.0"
#define AUTHOR "KGC Yash"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_cvar("knifeitup_hp""25")
    
register_cvar("knifeitup_adminhp""100")
    
register_cvar("knifeitup_frags""3")
    
register_event("DeathMsg""Event_DeathMsg_knife""a")
}


new 
knifesounds[5][] =
{
    
"sound/knifesound/knife1",
    
"sound/knifesound/knife2",
    
"sound/knifesound/knife3",
    
"sound/knifesound/knife4",
    
"sound/knifesound/knife5"
}

public 
Event_DeathMsg_knife()
{
    new 
Killer read_data(1)
    new 
Victim read_data(2)
    
    if (!
is_user_alive(Killer) || (Killer == Victim))
    return;
    
    new 
CheckWeapon[6];
    
read_data(4CheckWeapon5);
    
    if (
equal(CheckWeapon"knife"))
    {
        new 
php get_cvar_num("knifeitup_hp")
        new 
ahp get_cvar_num("knifeitup_adminhp")
        new 
frags get_cvar_num("knifeitup_frags")
        

        if(
get_user_flags(Killer) & ADMIN_KICK
        {
            
set_dhudmessage(016000.400.6026.012.0)
            
show_dhudmessage(0"%s Got %s Frags %s hp For Knifing Admin %s"KillerfragsahpVictim)
            
client_cmd(0"spk %s"knifesounds)
            
set_user_health(Killerget_user_health(Killer) + ahp)
            
set_user_frags(Killerget_user_frags(Killer) + frags)
        }
       else
        {
        
set_dhudmessage(016000.400.6026.012.0)    
        
show_dhudmessage(0"%s Got %s Frags %s hp For Knifing %s"KillerfragsphpVictim)
        
client_cmd(0"spk %s"knifesounds)
        
set_user_health(Killerget_user_health(Killer) + php)
        
set_user_frags(Killerget_user_frags(Killer) + frags)
       }
    } 


when anyone knifing he got the frags hp and all but when the msg coming it didin't showing players name, frags, hp and killer name. Please Check :'(

wickedd 12-11-2014 22:42

Re: [HELP] New Knifeitup Code Not Working :(
 
Here's a hint:
%s is for strings
%d is for integers

priyojit 12-11-2014 22:46

Re: [HELP] New Knifeitup Code Not Working :(
 
Quote:

Originally Posted by wickedd (Post 2234179)
Here's a hint:
%s is for strings
%d is for integers

bro i am learning please bro explain in details :cry:

popeye10 12-12-2014 02:44

Re: [HELP] New Knifeitup Code Not Working :(
 
it's better to use chat message. :3

priyojit 12-12-2014 04:19

Re: [HELP] New Knifeitup Code Not Working :(
 
Quote:

Originally Posted by popeye10 (Post 2234229)
it's better to use chat message. :3

i want to use hud message :\

tousif 12-12-2014 07:37

Re: [HELP] New Knifeitup Code Not Working :(
 
ADmins of this forum this code is copied plzz remove this post

tousif 12-12-2014 07:38

Re: [HELP] New Knifeitup Code Not Working :(
 
I have compiled it and some errors wer der so i posted here by Name Many errors this guy is coping all plugins and naming it as it is his

YamiKaitou 12-12-2014 10:11

Re: [HELP] New Knifeitup Code Not Working :(
 
Quote:

Originally Posted by priyojit (Post 2234181)
bro i am learning please bro explain in details :cry:

If you do not understand, then please go back to your studying before you actually start coding

zmd94 12-12-2014 11:28

Re: [HELP] New Knifeitup Code Not Working :(
 
PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <dhudmessage>  

#define PLUGIN "knifeitup"
#define VERSION "2.0"
#define AUTHOR "KGC Yash"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_cvar("knifeitup_hp""25")
    
register_cvar("knifeitup_adminhp""100")
    
register_cvar("knifeitup_frags""3")
    
register_event("DeathMsg""Event_DeathMsg_knife""a")
}


new 
knifesounds[5][] =
{
    
"sound/knifesound/knife1",
    
"sound/knifesound/knife2",
    
"sound/knifesound/knife3",
    
"sound/knifesound/knife4",
    
"sound/knifesound/knife5"
}

public 
Event_DeathMsg_knife()
{
    new 
Killer read_data(1)
    new 
Victim read_data(2)
    
    if (!
is_user_alive(Killer) || (Killer == Victim))
        return;
    
    new 
szName[32], szName2[32]
    
get_user_name(KillerszNamecharsmax(szName)) 
    
get_user_name(VictimszName2charsmax(szName2)) 
    
    new 
CheckWeapon[6];
    
read_data(4CheckWeapon5);
    
    if (
equal(CheckWeapon"knife"))
    {
        new 
php get_cvar_num("knifeitup_hp")
        new 
ahp get_cvar_num("knifeitup_adminhp")
        new 
frags get_cvar_num("knifeitup_frags")
        
        
        if(
get_user_flags(Killer) & ADMIN_KICK
        {
            
set_dhudmessage(016000.400.6026.012.0)
            
show_dhudmessage(0"%s Got %d Frags %d hp For Knifing Admin %s"szNamefragsahpszName2)
            
client_cmd(0"spk %s"knifesounds)
            
set_user_health(Killerget_user_health(Killer) + ahp)
            
set_user_frags(Killerget_user_frags(Killer) + frags)
        }
       else
        {
        
set_dhudmessage(016000.400.6026.012.0)    
        
show_dhudmessage(0"%s Got %d Frags %d hp For Knifing %s"szNamefragsphpszName2)
        
client_cmd(0"spk %s"knifesounds)
        
set_user_health(Killerget_user_health(Killer) + php)
        
set_user_frags(Killerget_user_frags(Killer) + frags)
       }
    } 



prinoybullboy 12-12-2014 12:12

Re: [HELP] New Knifeitup Code Not Working :(
 
This is not the original author :) admins please make a note :)


All times are GMT -4. The time now is 19:23.

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