Raised This Month: $32 Target: $400
 8% 

Problem remove knife


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xSaG
Junior Member
Join Date: Sep 2018
Location: Romānia
Old 02-08-2019 , 11:14   Problem remove knife
Reply With Quote #1

I started writing a JailBreak mod code. But I have a problem in the second round my knife on foot. I want to be deleted, I mention that in the first round everything works correctly

Sorry for bad English.
Spoiler


PHP Code:
// ON PLAYER SPAWN
public Action Event_PlayerSpawn(Event event, const char[] namebool dontBroadcast)  
{
    
int client GetClientOfUserId(GetEventInt(event"userid"));
    
int weapon
    for(
int i 05i++) 
    { 
        if((
weapon GetPlayerWeaponSlot(clienti)) != -1
        { 
            
SDKHooks_DropWeapon(clientweaponNULL_VECTORNULL_VECTOR); 
            
AcceptEntityInput(weapon"Kill"); 
        } 
    }
    if(
GetClientTeam(client) == 2)
    {
        
iMelee GivePlayerItem(client"weapon_fists"); 
        
EquipPlayerWeapon(clientiMelee);
    }
    if(
GetClientTeam(client) == 3)
    {    
        
iMelee GivePlayerItem(client"weapon_knife_m9_bayonet");
        
EquipPlayerWeapon(clientiMelee);
    }


Last edited by DarkDeviL; 02-09-2019 at 09:21. Reason: Restore to previous version.
xSaG is offline
farawayf
Senior Member
Join Date: Jan 2019
Old 02-12-2019 , 07:09   Re: Problem remove knife
Reply With Quote #2

Hook round_start
farawayf is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 02-12-2019 , 08:04   Re: Problem remove knife
Reply With Quote #3

PHP Code:

// ON PLAYER SPAWN 
public void Event_PlayerSpawn(Event event, const char[] namebool dontBroadcast)   

    
int client GetClientOfUserId(event.GetInt("userid")); 

    if (
client)
    {
        for (
int i 0<= CS_SLOT_C4i++)  
        {
            
int weapon = -1;
            while ((
weapon GetPlayerWeaponSlot(clienti)) != -1)  
            {  
                
CS_DropWeapon(clientweaponfalse);
                
AcceptEntityInput(weapon"Kill");  
            }
        }  

        if (
event.GetInt("teamnum") == CS_TEAM_T
        { 
            
int iMelee GivePlayerItem(client"weapon_fists");  
            
EquipPlayerWeapon(clientiMelee); 
        }
        else
        {     
            
int iMelee GivePlayerItem(client"weapon_knife_m9_bayonet"); 
            
EquipPlayerWeapon(clientiMelee); 
        }
    }

__________________
Ilusion9 is offline
Kellan123
AlliedModders Donor
Join Date: Aug 2012
Old 02-12-2019 , 10:06   Re: Problem remove knife
Reply With Quote #4

https://blog.counter-strike.net/inde...er_guidelines/
Kellan123 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 23:13.


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