Raised This Month: $ Target: $400
 0% 

Admin Vip Model + Announce


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
st0kata
Member
Join Date: Aug 2007
Old 11-01-2007 , 07:04   Admin Vip Model + Announce
Reply With Quote #1

Hi guys. I wanted to make a plugin that gives the Vip model to an admin when he joins the server cuz i couldn't find any plugin that does the same. Tbh i didn't try to search that much. I wanted to try to make one by myself. It's my first plugin for AmxModX so it's probably full up with mistakes. But the only thing that i don't get is why the Vip model is set after restartround not right after the admin joins a team.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define MAX_PLAYERS 32

new bool:g_restart_attempt[MAX_PLAYERS 1]

public 
plugin_init()
{
       
register_plugin("Admin Vip","1.0","st0ka")
       
register_event("ResetHUD""event_hud_reset""be")
       
register_clcmd("fullupdate""clcmd_fullupdate"
       
register_event("TextMsg""restart_attempt""a""2=#Game_will_restart_in")
}
 
public 
clcmd_fullupdate() 
{
       return 
PLUGIN_HANDLED_MAIN
}
 
public 
restart_attempt() 
{
       new 
players[32], num
       get_players
(playersnum"a")
       for (new 
inum; ++i)
       
g_restart_attempt[players[i]] = true
}
 
public 
event_hud_reset(id
{
       if (
g_restart_attempt[id]) 
       {
       
g_restart_attempt[id] = false
       
return
       }
       
set_model(id)
}

public 
set_model(id
{
       if (!
is_user_admin(id))
          return 
PLUGIN_HANDLED
       
else
       {
       
cs_set_user_model(id,"vip")
       
client_print(idprint_center"Welcome Admin!")
       }
       return 
PLUGIN_CONTINUE       
}

public 
client_putinserver(id)
{
       if (
is_user_admin(id))
       {  
          
       new 
szName[36], szMsg[66]
       
get_user_name(id,szName,35)
       
format(szMsg,65,"Admin %s has joined!",szName)
       
set_hudmessage(0,255,0,0.10,0.55,0,6.0,6.0,0.5,0.15,3)
       
show_hudmessage(0,szMsg)
       }

Another thing i wanted to ask is how to execute command on given IP.
amx_command IP
I couldn't find any examples :/
greetz st0ka
st0kata 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 01:23.


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