Quote:
Originally Posted by shanapu
I'm pretty sure you can do it yourself!
just insert this:
PHP Code:
GivePlayerItem(client, "weapon_smokegrenade");
GivePlayerItem(client, "weapon_flashbang");
behind
PHP Code:
GivePlayerItem(client, "weapon_hegrenade");
for smoke & flash.
|
I tried this before I wrote here, but I got a warning.
// D:\csgo\scripting\vip_grenade.sp(32) : warning 217: loose indentation
PHP Code:
#include <sourcemod>
#include <sdktools>
#pragma semicolon 1
#pragma newdecls required
ConVar gc_bPlugin;
public Plugin myinfo = {
name = "VIP Grenades on Spawn",
author = "shanapu",
description = "give grenades on spawn for vip",
version = "0.2",
url = "https://forums.alliedmods.net/showthread.php?t=300699"
};
public void OnPluginStart()
{
gc_bPlugin = CreateConVar("sm_spawn_he_enable", "1", "0 - disabled, 1 - enable plugin");
HookEvent("player_spawn", Event_PlayerSpawn);
}
public Action Event_PlayerSpawn(Handle event, char[] name, bool dontBroadcast)
{
if(gc_bPlugin.BoolValue)
{
int client = GetClientOfUserId(GetEventInt(event, "userid"));
if (CheckCommandAccess(client, "grenade_flag", ADMFLAG_CUSTOM6, true))
{
GivePlayerItem(client, "weapon_hegrenade");
GivePlayerItem(client, "weapon_smokegrenade");
GivePlayerItem(client, "weapon_flashbang");
if (GetClientTeam(client) == CS_TEAM_CT)
{
GivePlayerItem(client, "weapon_incgrenade");
}
else
{
GivePlayerItem(client, "weapon_molotov");
}
}
}
}
//// vip_grenade.sp
//
// D:\csgo\scripting\vip_grenade.sp(32) : warning 217: loose indentation
// D:\csgo\scripting\vip_grenade.sp(34) : error 017: undefined symbol "CS_TEAM_CT"
//
// 1 Error.
//
// Compilation Time: 0,52 sec
// ----------------------------------------
Press enter to exit ..
1 Error and 1 Warning.