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

Solved CS:GO Give Player P250 after Killing 5 Enemy with Knife


Post New Thread Reply   
 
Thread Tools Display Modes
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 07-14-2018 , 19:59   Re: CS:GO Give Player P250 after Killing 5 Enemy with Knife
Reply With Quote #21

Quote:
Originally Posted by mug1wara View Post
1st. micapat, I feel bad for you.
2nd. I don't know if this code is right, I'm tired so I might have done smth wrong, anyways just try it

PHP Code:
#include <sourcemod>
#include <sdktools>

#pragma semicolon 1

int g_iCount[MAXPLAYERS 1];

public 
void OnPluginStart()
{
    
HookEvent("player_team"Evet_Death);
}

public 
Action Evet_Death(Event hEvent, const char[] sNamebool bDontBroadcast)
{
    
int iVictim GetClientOfUserId(hEvent.GetInt("userid"));
    
    
int iAttacker GetClientOfUserId(hEvent.GetInt("attacker"));
    
    
g_iCount[iVictim] = 0;
    
    
char sWeapon[32];
    
    
GetClientWeapon(iAttackersWeaponsizeof(sWeapon));
    
    if (
StrEqual(sWeapon"weapon_knife"))
    {
        
g_iCount[iAttacker]++;
        
        if (
g_iCount[iAttacker] == 5)
        {
            
int iWeapon GetPlayerWeaponSlot(iAttacker2);
            
            if (
IsValidEntity(iWeapon))
            {
                
RemovePlayerItem(iAttackeriWeapon);
                
                
AcceptEntityInput(iWeapon"Kill");
            }
            
            
GivePlayerItem(iAttacker"weapon_p250");
            
            
g_iCount[iAttacker] = 0;
        }
    }

also the issue: other Player gets the P250 after I killed 5 Enemys
iskenderkebab33 is offline
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 07-14-2018 , 20:06   Re: CS:GO Give Player P250 after Killing 5 Enemy with Knife
Reply With Quote #22

Ok I fixed this issue. Test again.
__________________
micapat is offline
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 07-14-2018 , 20:12   Re: CS:GO Give Player P250 after Killing 5 Enemy with Knife
Reply With Quote #23

Quote:
Originally Posted by micapat View Post
Ok I fixed this issue. Test again.
working, fine. Many thanks!
iskenderkebab33 is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 07-14-2018 , 20:18   Re: CS:GO Give Player P250 after Killing 5 Enemy with Knife
Reply With Quote #24

but that's what u asked for? alright then
mug1wara is offline
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 07-14-2018 , 20:22   Re: CS:GO Give Player P250 after Killing 5 Enemy with Knife
Reply With Quote #25

Quote:
Originally Posted by mug1wara View Post
but that's what u asked for? alright then
If i Kill 5 Enemys with Knife i get a P250, what you understand? :/

but yeah, the Code with, a Random Player will be given the P250 is also nice, i can use it for other things. Thanks!

Last edited by iskenderkebab33; 07-14-2018 at 20:23.
iskenderkebab33 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 21:02.


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