Raised This Month: $ Target: $400
 0% 

Optimize Code


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Sanjay Singh
Veteran Member
Join Date: Sep 2016
Old 01-24-2020 , 08:04   Optimize Code
Reply With Quote #1

someone optimize code for me

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <csx>

#define TASK_PRESENTS 1337
#define TASK_SHOWHUD 2674

#define ID_PRESENTS (TaskIndex - TASK_PRESENTS)
#define ID_SHOWHUD (TaskIndex - TASK_SHOWHUD)


// Variabile
new MesajSync;


// Cvaruri
new cvar_hudenable

public plugin_init()
{
   
register_plugin("Hud Info""1.1""")
   
   
// Register Cvars
   
cvar_hudenable register_cvar("credits_hudstats""1")
   
   
// Register Messages
   
MesajSync CreateHudSyncObj()
   
   
register_message(get_user_msgid("SayText"), "message")
   
register_logevent("round_start"2"1=Round_Start")

   
}

public 
client_putinserver(id)
{
   
set_task(1.0"MesajHUD"id+TASK_SHOWHUD, .flags "b")
}


public 
MesajHUD(TaskIndex)
{
   static 
id
   id 
ID_SHOWHUD;
   
   if (!
is_user_alive(id))
   {
      
id pev(idpev_iuser2)
      
      if(!
is_user_alive(id)) return;
   }
   
   if (
get_pcvar_num(cvar_hudenable))
   {
      if(
id != ID_SHOWHUD)
      {
        new 
name[32];
        
get_user_name(idname31)

        new 
stats], body];

           new 
rank_pos get_user_statsidstatsbody )
        new 
rank_max get_statsnum( )

        
set_hudmessage(0100250, -1.00.7806.01.10.00.0, -1)
        
ShowSyncHudMsg(ID_SHOWHUDMesajSync"[ Spectating %s | Rank: %d/%d ]"namerank_posrank_max)
     }
   }

__________________

Last edited by Sanjay Singh; 01-24-2020 at 08:05.
Sanjay Singh is offline
Send a message via AIM to Sanjay Singh
 



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 02:44.


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