Raised This Month: $ Target: $400
 0% 

[CSGO] GivePlayerItem gives 2 grenades


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



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 05:17.


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