hello all this is my first time scripting anything
i found a random plugin someone posted that works great
but i need to make it admins only the server i am going to run at our lan party is a overwhelming number of bots vs us and i would like to mod a few of my plugins for just players not bot
so i found a plugin thats admin only and tried to splice it into the plugin and this is what i came up with
Code:
#include <clients>
new add;
new AdminFlag:cflag;
public OnPluginStart()
{
new Handle:cvar = CreateConVar("sm_kill_add_hp", "0", "Give this much HP every kill", FCVAR_NONE, true, 0.0);
add = GetConVarInt(cvar);
HookConVarChange(cvar, convar_changed);
CloseHandle(cvar);
HookEventEx("player_death", player_death);
}
public convar_changed(Handle:convar, const String:oldValue[], const String:newValue[])
{
add = StringToInt(newValue); // Note, cvar sm_kill_add_hp was limited to minimum 0.0
}
public player_death(Handle:event, const String:name[], bool:dontBroadcast)
{
if(!add) // Disabled
{
return;
}
new client_userid = GetEventInt(event, "userid");
new client = GetClientOfUserId(client_userid);
new AdminId:admin_id = GetUserAdmin(client);
{
new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
if(attacker != 0) // Not killed by world or else non-player
{
new victim = GetClientOfUserId(GetEventInt(event, "userid"));
if(attacker != victim) // Not suicide
{
if(!victim || GetClientTeam(attacker) != GetClientTeam(victim)) // Victim perhaps monster in TF2 ?? or Not team kill
{
if (admin_id != INVALID_ADMIN_ID && IsClientInGame(client) && GetAdminFlag(admin_id, cflag, AdmAccessMode:Access_Effective))
{
SetEntityHealth(attacker, GetClientHealth(attacker) + add);
}
}
}
}
error 030: compound statement not closed at the end of file (started at line 33)
please help our party is Saturday... oh and i can post working plugin if need be
also if anyone knows of a easier way of making a plugin "not a command" work for just selected players or admins i would save me some time as well "have a few more that need this also"
thank