Raised This Month: $ Target: $400
 0% 

[REQ CSGO] Flying text "ADMIN" on admin head


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Chesterfield
Senior Member
Join Date: Apr 2013
Old 12-04-2014 , 09:06   Re: [REQ CSGO] Flying text "ADMIN" on admin head
Reply With Quote #1

What it does exactly 8guanwong? and, if i remplace the vmf and vtf that you put there for something that i want to use, would it work?, and also, which dimensions it should have?

Thanks in advanced
Chesterfield is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 12-04-2014 , 09:35   Re: [REQ CSGO] Flying text "ADMIN" on admin head
Reply With Quote #2

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.1Create_Modelclient);
        }
    }
    
    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:iTimerany:client)
{
    
SafeDelete(g_Models[client]);
    
g_Models[client] = CreateIcon();
    
PlaceAndBindIcon(clientg_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(cliententity)
{
    new 
Float:origin[3];

    if(
IsValidEntity(entity)) {
        
GetClientAbsOrigin(clientorigin);
        
origin[2] = origin[2] + 90.0;
        
TeleportEntity(entityoriginNULL_VECTORNULL_VECTOR);

        
SetVariantString("!activator");
        
AcceptEntityInput(entity"SetParent"client);
    }
}

SafeDelete(entity)
{
    if(
IsValidEntity(entity)) {
        
AcceptEntityInput(entity"Kill");
    }


Last edited by 8guawong; 12-04-2014 at 09:40.
8guawong is offline
Chesterfield
Senior Member
Join Date: Apr 2013
Old 12-04-2014 , 13:42   Re: [REQ CSGO] Flying text "ADMIN" on admin head
Reply With Quote #3

Hello, thanks alot for your help, i am trying to make a vft with the logo of my community and next to it "ADMIN", after i'm done i'll tell you what happend !

Thanks again
Chesterfield is offline
Chesterfield
Senior Member
Join Date: Apr 2013
Old 12-04-2014 , 15:02   Re: [REQ CSGO] Flying text "ADMIN" on admin head
Reply With Quote #4

Hello again, i've made the logo and the "ADMIN" next to it as i wanted, but i have this issue, sometimes the image gets too dark, or full black, or maybe too bright, here are some screenshots so you can see.

http://fotos.subefotos.com/305373223...283cf20c0o.jpg - The logo looks good
http://fotos.subefotos.com/08f461850...a93969835o.jpg - The logo looks broken
http://fotos.subefotos.com/c21488cfb...82fc20b41o.jpg - The logo looks all black.

Here is what i wrote in the vmt

"LightmappedGeneric"
{
"$receiveflashlight" 0
"$singlepassflashlight" 0
"$basetexture" "sprites/pitbullicon2"
"$alphatest" 1
"$translucent" 1
"$vertexalpha" 1
}

Exactly as the vmt from the plugin that you gave me.

i'll attach you now the vmf and vtf, maybe you see something wrong with them and you can help me

Thanks in advanced and the plugin works great!
Attached Files
File Type: zip logo.zip (6.2 KB, 200 views)
Chesterfield is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-04-2014 , 15:56   Re: [REQ CSGO] Flying text "ADMIN" on admin head
Reply With Quote #5

...don't create LightmappedGeneric.
"sprite" works.

If I can stay wake tomorrow morning, I could give some sample.
Bacardi is offline
Chesterfield
Senior Member
Join Date: Apr 2013
Old 12-04-2014 , 16:25   Re: [REQ CSGO] Flying text "ADMIN" on admin head
Reply With Quote #6

Hello, so i've changed the "LightmappedGeneric" to "Sprite" and now it works correctly, thanks for telling me Bacardi !

Last edited by Chesterfield; 12-04-2014 at 16:56.
Chesterfield is offline
Chesterfield
Senior Member
Join Date: Apr 2013
Old 12-04-2014 , 16:56   Re: [REQ CSGO] Flying text "ADMIN" on admin head
Reply With Quote #7

Now it looks like this.




Quiality is not the best but it may be because of the resolution that i'm playing, anyway if there's a way to increase the quality (in the vmt options) please let me know.

Also, i see that the logo and the text are way too moved to the right, it should be, The logo should be a little on the left the text should be right above his head, and not right to his head, any tip to move it?

thanks in advanced guys

Last edited by Chesterfield; 12-04-2014 at 16:57.
Chesterfield is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 12-04-2014 , 19:44   Re: [REQ CSGO] Flying text "ADMIN" on admin head
Reply With Quote #8

everything should be centered since we just move the sprite up vertically
so you need to chnage your sprite
8guawong is offline
Chesterfield
Senior Member
Join Date: Apr 2013
Old 12-04-2014 , 20:04   Re: [REQ CSGO] Flying text "ADMIN" on admin head
Reply With Quote #9

Maybe it is because the dimentions of the image are too big? here's the vmf and the vtf so you see the dimention of the image, maybe you can help me !
Attached Files
File Type: zip sprites.zip (6.1 KB, 183 views)
Chesterfield is offline
medic917
Senior Member
Join Date: Aug 2014
Old 12-04-2014 , 20:35   Re: [REQ CSGO] Flying text "ADMIN" on admin head
Reply With Quote #10

I think he means the sprite has to be centered on your vtf file.

Any chance we can add support for multiple flags?
So we can add a different sprite for other flags (like admin, donor, owner).
medic917 is offline
Reply


Thread Tools
Display Modes

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 05:19.


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