Admin Vip Model + Announce
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(players, num, "a") for (new i; i < num; ++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(id, print_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
|