Raised This Month: $ Target: $400
 0% 

Remove Glock After Spawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 07-20-2017 , 09:33   Remove Glock After Spawn
Reply With Quote #1

Hello guys,
I have a problem. I am using a plugin that fixing glock bug after spawn.
But Some friends said me that "there are 2 bugs". And I am here to fix this problems with all of you

First bug;

After spawn; "If the user kills before plugin deletes his glock, It falls to ground. Everyone can take it from ground.

Second bug;

After spawn; "If the user drops the glock before plugin deletes his glock. It falls to ground. Everyone can take it from ground. Same things

I want to fix this problems like that "When the user kill, Will remove his glock automatic.
And When the user uses drop, Will not drop
Thanks for helping

PHP Code:
#include <amxmodx>
#include <reapi>

public plugin_init() {
    
register_plugin("Auto Weapon""1.0""PurposeLess")
    
    
RegisterHookChain(RG_CBasePlayer_Spawn"RGC_BasePlayerSpawn"1)
}

public 
RGC_BasePlayerSpawn(id)
{
    
remove_task(id)
    
remove_task(id+1907)

    if(
is_user_alive(id))
    {
        
rg_remove_all_items(id)
        
rg_give_item(id"weapon_knife")

        if(
get_member(idm_iTeam) == TEAM_CT)
        {
            
rg_give_item(id"weapon_usp")
            
rg_give_item(id"weapon_p90")
            
rg_give_item(id"weapon_deagle")
            
rg_give_item(id"weapon_m4a1")
            
rg_give_item(id"weapon_awp")
            
rg_give_item(id"weapon_ak47")
            
rg_set_user_bpammo(idWEAPON_M4A1200)
            
rg_set_user_bpammo(idWEAPON_AWP200)
            
rg_set_user_bpammo(idWEAPON_AK47200)
            
rg_set_user_bpammo(idWEAPON_USP100)
            
rg_set_user_bpammo(idWEAPON_P90200)
            
rg_set_user_bpammo(idWEAPON_DEAGLE100)
        }
        else if(
get_member(idm_iTeam) == TEAM_TERRORIST)
        {
            if(
task_exists(id)) remove_task(id)
            if(
task_exists(id+1907)) remove_task(id+1907)

            
set_task(0.1"glock_control"id 1907""0"b")
            
set_task(1.5"removetask"id)
            
engclient_cmd(id"weapon_knife")
        }
    }
}

public 
glock_control(TaskId)
{
    new 
id TaskId -= 1907
    
if(is_user_alive(id))
    {
        if(
rg_has_item_by_name(id"weapon_glock18"))
        {
            
rg_remove_item(id"weapon_glock18")
            if(
task_exists(id)) remove_task(id)
            if(
task_exists(id+1907)) remove_task(id+1907)
        }
    }
    else {
        if(
task_exists(id)) remove_task(id)
        if(
task_exists(id+1907)) remove_task(id+1907)
    }
}

public 
removetask(id)
{
    if(
task_exists(id)) remove_task(id)
    if(
task_exists(id+1907)) remove_task(id+1907)

PurposeLessx is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 07-20-2017 , 14:43   Re: Remove Glock After Spawn
Reply With Quote #2

remove the glock before enemy dies.
Spoiler
__________________
retired chump
DjSoftero is offline
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 07-20-2017 , 14:59   Re: Remove Glock After Spawn
Reply With Quote #3

Still there is a problem,
I used "amx_revive and kill"
Glock falls to ground many times.
Unfortunately it ain't working very well. It blocks some times

Last edited by PurposeLessx; 07-20-2017 at 15:17.
PurposeLessx is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 07-20-2017 , 18:30   Re: Remove Glock After Spawn
Reply With Quote #4

Search.

https://forums.alliedmods.net/showthread.php?p=2364171
__________________








CrazY. is offline
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 07-21-2017 , 10:40   Re: Remove Glock After Spawn
Reply With Quote #5

Quote:
Originally Posted by CrazY. View Post
You are king!!! Solved
PurposeLessx is offline
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 23:02.


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