Raised This Month: $51 Target: $400
 12% 

[Request] Inquire about some coding errors


Post New Thread Reply   
 
Thread Tools Display Modes
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-19-2020 , 13:36   Re: [Request] Inquire about some coding errors
Reply With Quote #11

Code:
register_event("DeathMsg","level_client_death","a") public client_death(killer, victim, weapon, hitplace)

Not only the names of the functions don't match, but "client_death" is a forward that exists in AMXX - https://www.amxmodx.org/api/tsx/client_death

Even if you managed to compile the code, it won't work because "level_client_death" doesn't exist.

Quote:
You made rank system before, I think you can help me
Why don't you simply use that plugin instead of trying to create a worse version of it?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 05-19-2020 , 16:14   Re: [Request] Inquire about some coding errors
Reply With Quote #12

Quote:
Originally Posted by OciXCrom View Post
Code:
register_event("DeathMsg","level_client_death","a") public client_death(killer, victim, weapon, hitplace)

Not only the names of the functions don't match, but "client_death" is a forward that exists in AMXX - https://www.amxmodx.org/api/tsx/client_death

Even if you managed to compile the code, it won't work because "level_client_death" doesn't exist.
I did it but when i killing i have never get xp so i think the problem in public level_client_death

PHP Code:
register_event("DeathMsg","level_client_death","a"
PHP Code:
public level_client_death(killervictimweaponhitplace)
{
    new 
victim_name[32]
    
get_user_name(victimvictim_namecharsmax(victim_name))
    
    new 
killer_team get_user_team(killer)
    new 
victim_team get_user_team(victim)
    
    
//NORMAL KILL
    
if((killer != victim) && !(killer_team == victim_team) && !(hitplace == HIT_HEAD) && !(weapon == CSW_HEGRENADE) && !(weapon == CSW_KNIFE))
    {
        
eXP[killer]+= get_pcvar_num(kill_xp)
    }
    
    
//HEADSHOT
    
if(hitplace == HIT_HEAD && !(weapon == CSW_KNIFE) && !(killer_team == victim_team))
    {
        
eXP[killer]+= get_pcvar_num(hs_xp)
    }
    
    
//KNIFE KILL
    
if(weapon == CSW_KNIFE && !(hitplace == HIT_HEAD) && !(killer_team == victim_team))
    {
        
eXP[killer]+= get_pcvar_num(knife_xp)
    }
    
    
//KNIFE + HEADSHOT
    
if(weapon == CSW_KNIFE && (hitplace == HIT_HEAD) && !(killer_team == victim_team))
    {
        
eXP[killer]+= get_pcvar_num(knife_xp)
    }
    
    
//GRENADE KILL
    
if(weapon == CSW_HEGRENADE && (killer != victim) && !(killer_team == victim_team))
    {
        
eXP[killer]+=get_pcvar_num(he_xp)
    }

    
CheckLevel(killer)
    
SaveData(killer)

Quote:
Why don't you simply use that plugin instead of trying to create a worse version of it?
Your plugin it have too many code, So if i want to add hud message of your plugin to my mod, i need to combine 2300 #Lines to my mod, it's to much, your plugin have some problems in rank prefix

Last edited by Supremache; 05-19-2020 at 16:15.
Supremache is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-19-2020 , 17:33   Re: [Request] Inquire about some coding errors
Reply With Quote #13

More code doesn't mean bad plugin. It has many configuration settings and you're able to adjust it to your exact needs. If you don't have sufficient scripting knowledge, what you're going to make here is much worse than the one you're refusing to use because of unjustified reasons.

What kind of a combination are you talking about? The plugin has a fully functional API which you can use in any plugin. You surely don't think that you need to put everything in the same .sma file?

What kind of problems are you talking about? I am not aware of any.
__________________

Last edited by OciXCrom; 05-19-2020 at 17:35.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 05-20-2020 , 05:09   Re: [Request] Inquire about some coding errors
Reply With Quote #14

Quote:
Originally Posted by OciXCrom View Post
More code doesn't mean bad plugin. It has many configuration settings and you're able to adjust it to your exact needs. If you don't have sufficient scripting knowledge, what you're going to make here is much worse than the one you're refusing to use because of unjustified reasons.

What kind of a combination are you talking about? The plugin has a fully functional API which you can use in any plugin. You surely don't think that you need to put everything in the same .sma file?

What kind of problems are you talking about? I am not aware of any.
All your plugins are the best, i have just 45 days learning amx coding so to now i don't know anything about config coding, so i can't edit you plugin as what i want.

Can i add hud message of your plugin to hud message of my mod without combing the codes together ?.

The problem in your plugin in "rank prefix", when i chat in server i getting two message that because your plugin is not allowed all prefix plugin.
Supremache is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-20-2020 , 07:13   Re: [Request] Inquire about some coding errors
Reply With Quote #15

Yes, you can easily combine the HUD with another plugin without touching the .sma of my plugin. That's what the API's for. Show the code of your HUD and I'll explain how you can do it.

Simple example of getting the current level of a player:

Code:
#include <crxranks> new level = crxranks_get_user_level(id)

Then just add the "level" variable to your HUD.
You can retrieve any othee information from the plugin - rank, XP, next level, any setting etc. Simply check the API to see all available functions - https://amxx-bg.info/api/crxranks

The problem is of 2 chat messages is caused by you using 2 different plugins that handle the chat. This includes admin prefixes, ranks, color chat, admin listen, all chat etc. You can only use one of those, so remove the other one you have - mine has all those options anyways.
__________________

Last edited by OciXCrom; 05-20-2020 at 07:16.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 05-20-2020 , 07:25   Re: [Request] Inquire about some coding errors
Reply With Quote #16

Quote:
Originally Posted by OciXCrom View Post
Yes, you can easily combine the HUD with another plugin without touching the .sma of my plugin. That's what the API's for. Show the code of your HUD and I'll explain how you can do it.

Simple example of getting the current level of a player:

Code:
#include <crxranks> new level = crxranks_get_user_level(id)

Then just add the "level" variable to your HUD.
You can retrieve any othee information from the plugin - rank, XP, next level, any setting etc. Simply check the API to see all available functions - https://amxx-bg.info/api/crxranks

The problem is of 2 chat messages is caused by you using 2 different plugins that handle the chat. This includes admin prefixes, ranks, color chat, admin listen, all chat etc. You can only use one of those, so remove the other one you have - mine has all those options anyways.
I understand now, but yesterday i was doing something different, i combine level prefix with tag prefix with cool design. this plugin was for zombie escape by dpcs team and i just edited it to working on basebuilder mod and everythings working perfectly, when i stop in something i will ask you.

Thanks for your support.
Supremache is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-20-2020 , 10:13   Re: [Request] Inquire about some coding errors
Reply With Quote #17

You can use my Chat Manager to achieve a "cool design" and it can as well be combined with my Rank System to show the ranks in chat. This feature is built in the plugin so you don't need to edit anything. You just need to edit the configuration file as described in the thread.

Basically, you should never combine plugins' .sma files. Always use an API system to do this.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 05-20-2020 , 10:52   Re: [Request] Inquire about some coding errors
Reply With Quote #18

Quote:
Originally Posted by OciXCrom View Post
You can use my Chat Manager to achieve a "cool design" and it can as well be combined with my Rank System to show the ranks in chat. This feature is built in the plugin so you don't need to edit anything. You just need to edit the configuration file as described in the thread.

Basically, you should never combine plugins' .sma files. Always use an API system to do this.
Thanks bro.
Supremache is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 05-24-2020 , 08:43   Re: [Request] Inquire about some coding errors
Reply With Quote #19

Bro, i need you support me for something, in level system there's a codes, that give humans and zombies xp when they wining and for this code working i should to add #include <basebuilder> right ??
After i did that it didn't worked

PHP Code:
public bb_round_ended()
{
    new 
Alive_Terrorists_Number GetPlayersNum(CsTeams:CS_TEAM_T)
    new 
Alive_CT_Numbers GetPlayersNum(CsTeams:CS_TEAM_CT)
    
    new 
iPlayers[32], iNum
    get_players
(iPlayersiNum"ace""CT")
    
    for (new 
0iNumi++)
    {
        if(
PlayerLevel[iPlayers[i]] < MAXLEVEL-1)
        {
            if((
Alive_CT_Numbers Alive_Terrorists_Number) && (Alive_Terrorists_Number == 0))
            {
                
set_user_xp(iPlayers[i], get_user_xp(iPlayers[i]) + get_pcvar_num(human_xp))
                
SaveLevel(iPlayers[i])
            }
            else if((
Alive_Terrorists_Number Alive_CT_Numbers) && (Alive_CT_Numbers == 0))
            {
                
set_user_xp(iPlayers[i], get_user_xp(iPlayers[i]) + get_pcvar_num(zombie_xp))
                
SaveLevel(iPlayers[i])
            }
            
check_level(iPlayers[i])
        }
    }

i had gone check basebuilder mod and i saw there's no Execute Forward code.

PHP Code:
public logevent_round_end()
{
    if (
g_boolRoundEnded)
    {
        new 
players[32], numplayer
        get_players
(playersnum)
        for (new 
0numi++)
        {
            
player players[i]
            
            if (
g_iCurTeam[player] == g_iTeam[player] )
                
cs_set_user_team(player, (g_iTeam[player] = (g_iTeam[player] == CS_TEAM_T CS_TEAM_CT CS_TEAM_T)))
            else
                
g_iTeam[player] = g_iTeam[player] == CS_TEAM_T CS_TEAM_CT CS_TEAM_T
        
}
        
print_color(0"%s^x04 %L"MODNAMELANG_SERVER"SWAP_ANNOUNCE")
        
    }
    
remove_task(TASK_BUILD)    
    return 
PLUGIN_HANDLED

So I did it

PHP Code:
new g_fwRoundEnd
g_fwRoundEnd 
CreateMultiForward("bb_round_ended"ET_IGNORE)
ExecuteForward(g_fwRoundEndg_fwDummyResultplayersg_iCurTeam[player]); 
Is that correct ??

After i did all that, sometimes had worked and now it didn't worked , can you tell me the reason ? and what is the problem i did ?
Supremache is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 05-24-2020 , 16:18   Re: [Request] Inquire about some coding errors
Reply With Quote #20

OciXCrom
Answer me and step by step the problem will be fixed
Supremache 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 08:38.


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