View Single Post
Author Message
trucka
Junior Member
Join Date: Jan 2019
Old 01-10-2019 , 17:39   Help trying to use item_kevlar in my sp
Reply With Quote #1

Trying to create a plugin that gives only kevlar to Ct's NOT helmet and armor. I realize you can use mp_free_armor 1 however I want it only for one team so this wouldn't work. Plugin seems to compile fine but its not working. Any help is much appreciated.

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



public Plugin:myinfo =
{
    name = "armor for ct",
    description = "basic plugin, give 100 armor to all cts uses code from last ct. Repurposed of course",
    author = "trucka",
    version = "1.0",
    url = ""
};


public OnPluginStart()
{
    HookEvent("round_start", roundStart);
}

public roundStart(Handle:event, String:name[], bool:dontBroadcast)
{
    new userid = GetEventInt(event, "userid");
    new client = GetClientOfUserId(userid);
    if (IsClientInGame(client) && GetClientTeam(client) == 3 && IsPlayerAlive(client)) {
		GivePlayerItem(client, "item_kevlar");
	}
}

Last edited by trucka; 01-10-2019 at 18:08.
trucka is offline