Raised This Month: $ Target: $400
 0% 

Is it possible to optimize this?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
neverminde
Senior Member
Join Date: Feb 2011
Location: St.Piter
Old 04-13-2011 , 09:35   Is it possible to optimize this?
Reply With Quote #1

hi, i have tried to write small and simple plugin by myself, which should make welcome hud massege. I think there are some useless code. Is it possible to make it better?
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

#define PLUGIN "hud_welcome"
#define VERSION "1.0"
#define AUTHOR "neverminde111"

new bool:g_first[33]

public 
plugin_init()
{
    
register_pluginPLUGINVERSIONAUTHOR )
}
 
public 
client_connect(id)
{
    
g_first[id]=true;
}

public 
client_disconnect(iPlayer)
{
    if(
task_exists(iPlayer))
    {
        
remove_task(iPlayer)
    }


public 
client_putinserverid )
{
    
set_task(0.5,"welcome",id,_,_,"a",7)
}

public 
welcome(iPlayer)
{
    if(
g_first[iPlayer]==true)
    {
        
g_first[iPlayer]=false

        
new szName32 ]
        
get_user_nameiPlayerszName31 )
        
set_hudmessage(025500.050.6321.03.50.050.05)
        
show_hudmessage(iPlayer"Hi, %s, nice to see you",szName)    
    }
    return 
PLUGIN_HANDLED

neverminde is offline
 



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 19:55.


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