View Single Post
Author Message
bcKq
Member
Join Date: Dec 2012
Location: Tczew, Poland
Old 02-01-2016 , 12:47   [CSGO] GivePlayerItem gives 2 grenades
Reply With Quote #1

Hello. I've written a small plugin that should give grenades after PlayerSpawn and it does give, but it gives two of them, and I want it to spawn only one.
CVars are correct (ammo_grenade_limit_default and _flashbang set to 1) but it does spawn additional smoke and flashbang on the ground, under player's foot. I don't know why, that's why I need help

code:
PHP Code:
public Event_OnPlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    
    if (
client && IsPlayerAlive(client))
    {
        if (
IsPlayerGenericAdmin(client))
        {
            
CreateTimer(1.0GiveStuffToPlayerclient);
        }
    }
}

public 
Action GiveStuffToPlayer(Handle timerany client)
{            
    
GivePlayerItem(client"weapon_smokegrenade");
    
GivePlayerItem(client"weapon_flashbang");
    
SetEntProp(clientProp_Send"m_ArmorValue"100); 
    
SetEntProp(clientProp_Send"m_bHasHelmet"1); 

__________________
This is my signature.
bcKq is offline