exactly what you wanted
http://steamcommunity.com/id/8guawon...67894382553180
but this only gives every1 the "flying text"
you need to replace the name of the sprite that you are going to use
the following code gives only people with root flag the "flying text"
change ADMFLAG_ROOT to something else if you want other than flag z
http://cooltext.com/Logo-Design-Skate (i used font 32) for the above picture
u can experience yourself
or it can end up like this
http://steamcommunity.com/sharedfile.../?id=350953877
PHP Code:
#include <sourcemod>
#include <sdktools>
#pragma semicolon 1
#define OVERLAY "materials/sprites/sg_detective_icon.vmt" //replace the name of file you going to use here
#define OVERLAY_2 "materials/sprites/sg_detective_icon.vtf" //replace the name of file you going to use here
new bool:g_bPrecached = false;
new g_Models[MAXPLAYERS + 1] = {-1, ...};
public OnPluginStart()
{
HookEvent("player_spawn", Event_PlayerSpawn);
HookEvent("player_death", Event_PlayerDeath);
}
public OnMapStart()
{
g_bPrecached = false;
AddFileToDownloadsTable(OVERLAY);
AddFileToDownloadsTable(OVERLAY_2);
if(!PrecacheModel(OVERLAY)) {
LogMessage("Cannot precache %s", OVERLAY);
return;
}
g_bPrecached = true;
}
public Action:Event_PlayerSpawn(Handle:event, const String:name[], bool:dontbroadcast)
{
if(!g_bPrecached) return Plugin_Continue;
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if(GetUserFlagBits(client) & ADMFLAG_ROOT) {
if(IsClientInGame(client) && IsPlayerAlive(client)) {
CreateTimer(0.1, Create_Model, client);
}
}
return Plugin_Continue;
}
public Action:Event_PlayerDeath(Handle:event, const String:name[], bool:dontbroadcast)
{
if(!g_bPrecached) return Plugin_Continue;
new client = GetClientOfUserId(GetEventInt(event, "userid"));
SafeDelete(g_Models[client]);
g_Models[client] = -1;
return Plugin_Continue;
}
public Action:Create_Model(Handle:iTimer, any:client)
{
SafeDelete(g_Models[client]);
g_Models[client] = CreateIcon();
PlaceAndBindIcon(client, g_Models[client]);
}
CreateIcon()
{
new sprite = CreateEntityByName("env_sprite_oriented");
if(sprite == -1) return -1;
DispatchKeyValue(sprite, "classname", "env_sprite_oriented");
DispatchKeyValue(sprite, "spawnflags", "1");
DispatchKeyValue(sprite, "scale", "0.3");
DispatchKeyValue(sprite, "rendermode", "1");
DispatchKeyValue(sprite, "rendercolor", "255 255 255");
DispatchKeyValue(sprite, "model", OVERLAY);
if(DispatchSpawn(sprite)) return sprite;
return -1;
}
PlaceAndBindIcon(client, entity)
{
new Float:origin[3];
if(IsValidEntity(entity)) {
GetClientAbsOrigin(client, origin);
origin[2] = origin[2] + 90.0;
TeleportEntity(entity, origin, NULL_VECTOR, NULL_VECTOR);
SetVariantString("!activator");
AcceptEntityInput(entity, "SetParent", client);
}
}
SafeDelete(entity)
{
if(IsValidEntity(entity)) {
AcceptEntityInput(entity, "Kill");
}
}