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

Need Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DON KHAN 1
Senior Member
Join Date: Mar 2019
Location: Pakistan
Old 07-11-2020 , 04:26   Need Help
Reply With Quote #1

Hi Modders,
I'm running basebuilder mod in my server.

I need a help about given bugs:

1) During Prepare Time when u choose weapons u can hit zombies.
2) When round is ended human/zombies can still damage but i want to make it block when round ended neither zombies cant damage humans nor humans can shoot zombies.
3) Bots cant stay in Spectator when round ends they transferred into T team automatically.

I tried to fix but it didn't fixed.

Thank You
Attached Files
File Type: sma Get Plugin or Get Source (basebuilder.sma - 206 views - 83.1 KB)
__________________
Facebook
My YouTube
Ro{Y}aL WarLanD CommuniTy
Selling Zombie CSO 4.3 Money System Mod

Last edited by DON KHAN 1; 07-11-2020 at 04:27.
DON KHAN 1 is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 07-11-2020 , 09:42   Re: Need Help
Reply With Quote #2

Quote:
Originally Posted by DON KHAN 1 View Post
Hi Modders,
I'm running basebuilder mod in my server.

I need a help about given bugs:

1) During Prepare Time when u choose weapons u can hit zombies.
2) When round is ended human/zombies can still damage but i want to make it block when round ended neither zombies cant damage humans nor humans can shoot zombies.
3) Bots cant stay in Spectator when round ends they transferred into T team automatically.

I tried to fix but it didn't fixed.

Thank You
About: first and second questions: Follow those codes

This is orginal code:

PHP Code:
public ham_TakeDamage(victiminflictorattackerFloat:damagedamagebits)
{
    if (!
is_valid_ent(victim) || !g_isAlive[victim] || !is_user_connected(attacker))
        return 
HAM_IGNORED
        
    
if(g_boolCanBuild || g_boolRoundEnded || g_boolPrepTime)
        return 
HAM_SUPERCEDE;
        
    if (
victim == attacker)
        return 
HAM_SUPERCEDE;
        
    if (
g_iSupercut)
    {
        
damage*=99.0
    
}
        
    
SetHamParamFloat(4damage)
    return 
HAM_HANDLED

In this code [ if(g_boolCanBuild || g_boolRoundEnded || g_boolPrepTime) ] If you remove g_boolPrepTime then player's can damage them at preptime, You said When round is ended human/zombies can still damage but i want to make it block when round ended neither zombies cant damage humans nor humans can shoot zombies but it's already added in the mod " g_boolRoundEnded", If you removed it then players can damage the enemy team and if you added it players can't damage the enemy team after round ended.


PHP Code:
public client_death(g_attackerg_victimwpnindexhitplaceTK)
{
    if (
is_user_alive(g_victim))
        return 
PLUGIN_HANDLED;
    
    
remove_task(g_victim+TASK_IDLESOUND)
    
    
g_isAlive[g_victim] = false;
    
    if (
TK == && g_attacker != g_victim && g_isZombie[g_attacker])
    {
        
client_cmd(0"spk %s"INFECTION)
        new 
szPlayerName[32]
        
get_user_name(g_victimszPlayerName31)
        
set_hudmessage(0255255, -1.00.4501.05.00.10.21)
        
show_hudmessage(0"%L"LANG_SERVER"INFECT_ANNOUNCE"szPlayerName);
    }
    
    
set_hudmessage(0255255, -1.00.4501.010.00.10.21)
    if (
g_isZombie[g_victim])
    {
        
show_hudmessage(g_victim"%L"LANG_SERVER"DEATH_ZOMBIE"g_iZombieTime);
        
set_task(float(g_iZombieTime), "Respawn_Player"g_victim+TASK_RESPAWN)
    }
    else if (
g_iInfectTime)
    {
        
show_hudmessage(g_victim"%L"LANG_SERVER"DEATH_HUMAN"g_iInfectTime);
        
cs_set_user_team(g_victimCS_TEAM_T)
        
g_isZombie[g_victim] = true
        set_task
(float(g_iInfectTime), "Respawn_Player"g_victim+TASK_RESPAWN)
    }
    
    return 
PLUGIN_CONTINUE;

In this code too add this:
PHP Code:
if (g_boolRoundEnded)
        return 
PLUGIN_HANDLED
About: The third question add this code in task section of bots plugin
PHP Code:
cs_set_user_teamBotCS_TEAM_UNASSIGNED ); 

Last edited by Supremache; 07-11-2020 at 09:52.
Supremache is offline
DON KHAN 1
Senior Member
Join Date: Mar 2019
Location: Pakistan
Old 07-11-2020 , 11:56   Re: Need Help
Reply With Quote #3

Quote:
Originally Posted by Supremache View Post
About: The third question add this code in task section of bots plugin
PHP Code:
cs_set_user_teamBotCS_TEAM_UNASSIGNED ); 
It is already added but the problem is not with bots only it happens with everyone who join specs.
And also i am using auto join on connect plugin https://forums.alliedmods.net/showthread.php?p=438587 but it isn't working.
__________________
Facebook
My YouTube
Ro{Y}aL WarLanD CommuniTy
Selling Zombie CSO 4.3 Money System Mod
DON KHAN 1 is offline
Old 07-11-2020, 17:27
Supremache
This message has been deleted by Supremache. Reason: Didn't saw the post
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 07-11-2020 , 17:40   Re: Need Help
Reply With Quote #4

Add those code and test it

PHP Code:
// Message IDs vars
new g_msgTeamInfo;

//Offsets
#define m_iTeam  114
#define CBASEMONSTER_LINUX_XTRA_OFF     5 
PHP Code:
// Message IDs
    
g_msgTeamInfo get_user_msgid("TeamInfo"); 
PHP Code:
        if(pev_valid(Bot) != 2)
        return;

    
set_pdata_int(Botm_iTeam3CBASEMONSTER_LINUX_XTRA_OFF);
    
    
dllfunc(DLLFunc_ClientUserInfoChangedBotengfunc(EngFunc_GetInfoKeyBufferBot));

        
message_begin(MSG_BROADCASTg_msgTeamInfo);
    
write_byte(Bot);
    
write_string("SPECTATOR");
    
message_end(); 

Last edited by Supremache; 07-11-2020 at 17:41.
Supremache is offline
DON KHAN 1
Senior Member
Join Date: Mar 2019
Location: Pakistan
Old 07-12-2020 , 02:42   Re: Need Help
Reply With Quote #5

Quote:
Originally Posted by Supremache View Post
Add those code and test it

PHP Code:
// Message IDs vars
new g_msgTeamInfo;

//Offsets
#define m_iTeam  114
#define CBASEMONSTER_LINUX_XTRA_OFF     5 
PHP Code:
// Message IDs
    
g_msgTeamInfo get_user_msgid("TeamInfo"); 
PHP Code:
        if(pev_valid(Bot) != 2)
        return;

    
set_pdata_int(Botm_iTeam3CBASEMONSTER_LINUX_XTRA_OFF);
    
    
dllfunc(DLLFunc_ClientUserInfoChangedBotengfunc(EngFunc_GetInfoKeyBufferBot));

        
message_begin(MSG_BROADCASTg_msgTeamInfo);
    
write_byte(Bot);
    
write_string("SPECTATOR");
    
message_end(); 

Okay gonna test it.

EDITED:
Not Working. The problem is even human also cant stay in spectator idk why next round they get transfer to T team.
__________________
Facebook
My YouTube
Ro{Y}aL WarLanD CommuniTy
Selling Zombie CSO 4.3 Money System Mod

Last edited by DON KHAN 1; 07-12-2020 at 03:05.
DON KHAN 1 is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 07-12-2020 , 06:02   Re: Need Help
Reply With Quote #6

Quote:
Originally Posted by DON KHAN 1 View Post
Okay gonna test it.

EDITED:
Not Working. The problem is even human also cant stay in spectator idk why next round they get transfer to T team.
Edit auto team join plugin and add this code

PHP Code:
 if (!is_user_bot(id)) { // Block bots
Return 0;

Sorry iam on phone but I think you know how to type this code

Last edited by Supremache; 07-12-2020 at 06:03.
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 06:53.


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