Raised This Month: $ Target: $400
 0% 

Remove Glock After Spawn


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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