Raised This Month: $ Target: $400
 0% 

get server ip!


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
SpyDevil
BANNED
Join Date: Jul 2010
Location: TURKiYE
Old 12-05-2010 , 19:45   Re: get server ip!
Reply With Quote #14

PHP Code:
#define PLUGIN  "Spectator Banner Ads"
#define VERSION "0.1.16"
#define AUTHOR  "iG_os"

#include <amxmodx>

#define SVC_DIRECTOR 51  // come from util.h
#define DRC_CMD_BANNER 9 // come from hltv.h

new szTga[64
func() {     
new 
serverip[32]     
get_user_ip0serverip31 // gets ip of server     
formatexszTga63"gfx/%s.tga"serverip 
}

new 
pCVAR_Tga
new g_SendOnce[33]

public 
plugin_precache()
{
   
register_plugin(PLUGINVERSIONAUTHOR)
   
register_logevent("joined_team"3"1=joined team")

   
pCVAR_Tga register_cvar("spec_banner_ads""1")

   if (
get_pcvar_num(pCVAR_Tga))
   {
      for (new 
i=0i<1i++)
         
precache_generic(szTga[i])
   }
}


public 
client_putinserver(id)
{
   
g_SendOnce[id] = true
}


public 
joined_team()
{
   new 
loguser[80], name[32]
   
read_logargv(0loguser79)
   
parse_loguser(logusername31)
   new 
id get_user_index(name)

   if ( 
get_pcvar_num(pCVAR_Tga) && g_SendOnce[id] && is_user_connected(id) )
   {
      
// random select one tga
      
new index random_num01)
      
g_SendOnce[id] = false

      
// send show tga command to client
      
message_beginMSG_ONESVC_DIRECTOR_id )
      
write_bytestrlenszTga[index]) + // command length in bytes
      
write_byteDRC_CMD_BANNER )
      
write_stringszTga[index] ) // banner file
      
message_end()
   }


last coded... but i take error when i installed to server
SpyDevil is offline
Send a message via ICQ to SpyDevil Send a message via MSN to SpyDevil
 



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 11:23.


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