Raised This Month: $ Target: $400
 0% 

Can someone fix this plugin for me?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Avaray
Member
Join Date: Dec 2011
Location: Germany
Old 01-10-2014 , 18:52   Can someone fix this plugin for me?
Reply With Quote #1

Im trying to create plugin. I dont know what to do.

Error in lines 14, 19, 24
// error 092: number of arguments does not match definition

This plugin should create annotation above admin head when round ends, and hide that annotation when new round begins or when he die.

PHP Code:
#include <sourcemod>
#include <sdktools>
#pragma semicolon 1

public OnPluginStart()
{
    
HookEvent("round_start"Event_RoundStart);
    
HookEvent("teamplay_round_win"Event_RoundWin);
    
HookEventEx("player_death"event_player_deathEventHookMode_Post);
}

public 
Event_RoundWin(Handle:event, const String:name[], bool:dontBroadcast)
{
    
ShowADMIN();
}

public 
Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
    
HideADMIN();
}

public 
Action:event_player_death(Handle:event, const String:name[], bool:dontBroadcast)
{
    
HideADMIN();
}

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);

And is that line #9 Ok?
__________________

Last edited by Avaray; 01-10-2014 at 18:58.
Avaray is offline
arthurdead
Senior Member
Join Date: Jul 2013
Old 01-10-2014 , 19:19   Re: Can someone fix this plugin for me?
Reply With Quote #2

Quote:
Originally Posted by Avaray View Post
Im trying to create plugin. I dont know what to do.

Error in lines 14, 19, 24
// error 092: number of arguments does not match definition

This plugin should create annotation above admin head when round ends, and hide that annotation when new round begins or when he die.

PHP Code:
#include <sourcemod>
#include <sdktools>
#pragma semicolon 1

public OnPluginStart()
{
    
HookEvent("round_start"Event_RoundStart);
    
HookEvent("teamplay_round_win"Event_RoundWin);
    
HookEventEx("player_death"event_player_deathEventHookMode_Post);
}

public 
Event_RoundWin(Handle:event, const String:name[], bool:dontBroadcast)
{
    
ShowADMIN();
}

public 
Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
    
HideADMIN();
}

public 
Action:event_player_death(Handle:event, const String:name[], bool:dontBroadcast)
{
    
HideADMIN();
}

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);

And is that line #9 Ok?
PHP Code:
#include <sourcemod> 
#include <sdktools> 
#pragma semicolon 1 

public OnPluginStart() 

    
HookEvent("round_start"Event_RoundStart); 
    
HookEvent("teamplay_round_win"Event_RoundWin); 
    
HookEventEx("player_death"event_player_deathEventHookMode_Post); 


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


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


public 
Action:event_player_death(Handle:event, const String:name[], bool:dontBroadcast
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    if(
GetUserFlagBits(client) & ADMFLAG_ROOTHideADMIN(client); 


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); 

might work idk
arthurdead is offline
Mathias.
Veteran Member
Join Date: Aug 2010
Location: Canada is my city
Old 01-10-2014 , 20:24   Re: Can someone fix this plugin for me?
Reply With Quote #3

line 9 could be replaced by HookEvent but it dosnt matter, just that HookEventEx return a value and HookEvent don't return any value and in this code there is nothing to catch this value, but it won't affect the code anyway.
Mathias. is offline
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
Mathias.
Veteran Member
Join Date: Aug 2010
Location: Canada is my city
Old 01-10-2014 , 21:20   Re: Can someone fix this plugin for me?
Reply With Quote #5

Don't remove it, I was just saying that you could change it, instead of HookEventEx("player_death", event_player_death, EventHookMode_Post); change it for HookEvent("player_death", event_player_death, EventHookMode_Post); but it dosnt change the final result of what the plugin is doing.
Mathias. is offline
Avaray
Member
Join Date: Dec 2011
Location: Germany
Old 01-10-2014 , 22:01   Re: Can someone fix this plugin for me?
Reply With Quote #6

I removed it because I dont need it.
__________________
Avaray is offline
Mathias.
Veteran Member
Join Date: Aug 2010
Location: Canada is my city
Old 01-10-2014 , 23:25   Re: Can someone fix this plugin for me?
Reply With Quote #7

oh ok
Mathias. is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 01-12-2014 , 01:17   Re: Can someone fix this plugin for me?
Reply With Quote #8

Heh, this was made with the snippet I released.

Good luck with this. I gave up on making plugins with annotations because they're so bloody tricky.

Hopefully you can make something great.
404UserNotFound is offline
Avaray
Member
Join Date: Dec 2011
Location: Germany
Old 01-12-2014 , 06:53   Re: Can someone fix this plugin for me?
Reply With Quote #9

I see. So I'll try with sprite attachment.
__________________
Avaray is offline
Reply



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 13:36.


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