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

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


Post New Thread Reply   
 
Thread Tools Display Modes
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 07-14-2018 , 19:15   Re: CS:GO Give Player P250 after Killing 5 Enemy with Knife
Reply With Quote #11

And what happends after this p250 has been given? Should other p250 be given if another player does 5 knife kills?

You really need to be more specific.

I update the code above.
__________________
micapat is offline
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 07-14-2018 , 19:18   Re: CS:GO Give Player P250 after Killing 5 Enemy with Knife
Reply With Quote #12

Quote:
Originally Posted by micapat View Post
And what happends after this p250 has been given? Should other p250 be given if another player does 5 knife kills?

You really need to be more specific.

I update the code above.
one Round you can kill 5 Enemeys with your Knife, after 5 Kills and given P250, no Kill Counter anymore.
If a new Round starts the Kill Counter will be resetet.
iskenderkebab33 is offline
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 07-14-2018 , 19:22   Re: CS:GO Give Player P250 after Killing 5 Enemy with Knife
Reply With Quote #13

Quote:
Originally Posted by micapat View Post
And what happends after this p250 has been given? Should other p250 be given if another player does 5 knife kills?

You really need to be more specific.

I update the code above.
still not working :/ random Player gets the P250
iskenderkebab33 is offline
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 07-14-2018 , 19:25   Re: CS:GO Give Player P250 after Killing 5 Enemy with Knife
Reply With Quote #14

Updated again (https://forums.alliedmods.net/showpo...56&postcount=4).

If 1 player gets 5 knife kills, a random player will get a p250 (Can be the killer himself). Nobody will be able to get another p250 until the round restart.
__________________
micapat is offline
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 07-14-2018 , 19:31   Re: CS:GO Give Player P250 after Killing 5 Enemy with Knife
Reply With Quote #15

Quote:
Originally Posted by micapat View Post
Updated again (https://forums.alliedmods.net/showpo...56&postcount=4).

If 1 player gets 5 knife kills, a random player will get a p250 (Can be the killer himself). Nobody will be able to get another p250 until the round restart.
still the same :/ P250 will be given to a Random Player after i kill 5 Enemys

Last edited by iskenderkebab33; 07-14-2018 at 19:31.
iskenderkebab33 is offline
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 07-14-2018 , 19:33   Re: CS:GO Give Player P250 after Killing 5 Enemy with Knife
Reply With Quote #16

....Isn't what you requested #10?
__________________
micapat is offline
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 07-14-2018 , 19:37   Re: CS:GO Give Player P250 after Killing 5 Enemy with Knife
Reply With Quote #17

Quote:
Originally Posted by micapat View Post
....Isn't what you requested #10?
oh, my bad, i'm sorry, i mean:

- Give Player after 5 Kills with the Knife a P250
- Reset Counter if Player dies

.. but thats also a nice Plugin will save it.
iskenderkebab33 is offline
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 07-14-2018 , 19:48   Re: CS:GO Give Player P250 after Killing 5 Enemy with Knife
Reply With Quote #18

Updated.

Modify the constant "C_KILL_TRIGGER" if you want to change the number of kills before getting a p250.
__________________
micapat is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 07-14-2018 , 19:54   Re: CS:GO Give Player P250 after Killing 5 Enemy with Knife
Reply With Quote #19

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;
        }
    }

mug1wara is offline
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 07-14-2018 , 19:55   Re: CS:GO Give Player P250 after Killing 5 Enemy with Knife
Reply With Quote #20

Quote:
Originally Posted by micapat View Post
Updated.

Modify the constant "C_KILL_TRIGGER" if you want to change the number of kills before getting a p250.
now, the p250 will not given after 5 Kills.
iskenderkebab33 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 14:38.


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