View Single Post
Avaray
Member
Join Date: Dec 2011
Location: Germany
Old 01-10-2014 , 20:56   Re: Can someone fix this plugin for me?
Reply With Quote #4

I tried with arthurdead's code with only admin flag change (from root to generic).
Plugin was compiled and loaded on server.
Admins didnt received annotations above head (or anywhere) at teamplay_round_win event.

Also I removed that 9th line and player_death things.

Heres my actual (not working) code:
PHP Code:
#include <sourcemod> 
#include <sdktools> 
#pragma semicolon 1 

public OnPluginStart() 

    
HookEvent("round_start"Event_RoundStart); 
    
HookEvent("teamplay_round_win"Event_RoundWin); 


public 
Event_RoundWin(Handle:event, const String:name[], bool:dontBroadcast
{
    for (new 
iClient=1iClient<=MaxClientsiClient++)
    {
        if(
GetUserFlagBits(iClient) & ADMFLAG_GENERIC) continue;
        
ShowADMIN(iClient); 
    }


public 
Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast
{
    for (new 
iClient=1iClient<=MaxClientsiClient++)
    {
        if(
GetUserFlagBits(iClient) & ADMFLAG_GENERIC) continue;
        
HideADMIN(iClient); 
    }
}

ShowADMIN(client

    if (!
client && !IsClientInGame(client) && !IsPlayerAlive(client) && CheckCommandAccess(client"generic_admin"ADMFLAG_GENERICtrue))  
        { 
            new 
Handle:event CreateEvent("show_annotation"); 
            if(
event == INVALID_HANDLE) return; 
            
SetEventInt(event"follow_entindex"client); 
            
SetEventInt(event"id"client); 
            
SetEventFloat(event"lifetime"86400.0); 
            
SetEventString(event"text""ADMIN"); 
            
FireEvent(event); 
        } 


HideADMIN(client

    new 
Handle:event CreateEvent("hide_annotation"); 
    if(
event == INVALID_HANDLE) return; 
    
SetEventInt(event"id"client); 
    
FireEvent(event); 

__________________

Last edited by Avaray; 01-10-2014 at 20:57.
Avaray is offline