Raised This Month: $ Target: $400
 0% 

Show rank sprite above head during freezetime


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Airkish
AlliedModders Donor
Join Date: Apr 2016
Location: Lithuania
Old 11-25-2017 , 07:54   Show rank sprite above head during freezetime
Reply With Quote #1

wzup boys and lads,

Im in need of a plugin which would show sprite above head according to player's rank during freezetime only.
There's 18 ranks in total.

I imagine something like

PHP Code:
switch(Rang[id]) {
    case 
0: {
        
//Do nothing, because 0 = unranked
    
}
    case 
1: {
        
//Show Silver I sprite above head
    
}
    
//...

Thanks
__________________
Airkish is offline
TheWhitesmith
Senior Member
Join Date: Oct 2017
Location: Morocco :c
Old 11-25-2017 , 09:32   Re: Show rank sprite above head during freezetime
Reply With Quote #2

Something similar was made, you just have to get those sprites and make minor changes to the code.
https://forums.alliedmods.net/showthread.php?t=181306
__________________
TheWhitesmith is offline
Old 11-25-2017, 09:33
TheWhitesmith
This message has been deleted by TheWhitesmith. Reason: double
Airkish
AlliedModders Donor
Join Date: Apr 2016
Location: Lithuania
Old 11-25-2017 , 10:48   Re: Show rank sprite above head during freezetime
Reply With Quote #3

I just need a code how to set and unset sprites
__________________
Airkish is offline
Visinescu
Senior Member
Join Date: Dec 2015
Location: England now,Home Romania
Old 12-05-2017 , 05:38   Re: Show rank sprite above head during freezetime
Reply With Quote #4

I'm actually interested in this as well. but not military ranks. just top15 ranks
Visinescu is offline
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 12-05-2017 , 06:39   Re: Show rank sprite above head during freezetime
Reply With Quote #5

Try and help me in paypal system =) because im not have any ideas with mysql / PHP
PHP Code:
public Show_Attachment(id, const Sprite[],  Float:TimeFloat:ScaleFloat:FrameRateTotalFrameType)
{
    if(!
is_user_alive(id))
        return

    static 
EntEnt engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"env_sprite"))
    if(!
pev_valid(Ent))
        return
    
    
// Set Properties
    
set_pev(Entpev_takedamageDAMAGE_NO)
    
set_pev(Entpev_solidSOLID_NOT)
    
set_pev(Entpev_movetypeMOVETYPE_FOLLOW)
    
    
// Set Sprite
    
set_pev(Entpev_classnameATTACHMENT_CLASSNAME)
    
engfunc(EngFunc_SetModelEntSprite)
    
    
// Set Rendering
    
set_pev(Entpev_renderfxkRenderFxNone)
    
set_pev(Entpev_rendermodekRenderTransAdd)
    
set_pev(Entpev_renderamt200.0)
    
    
// Set other
    
set_pev(Entpev_userid)
    
set_pev(Entpev_typeType)
    
set_pev(Entpev_scaleScale)
    
set_pev(Entpev_livetimeget_gametime() + Time)
    
set_pev(Entpev_totalframefloat(TotalFrame))
    
    
// Set Origin
    
static Float:Origin[3]; pev(idpev_originOrigin)
    if(!
Type)
    {
        if(!(
pev(idpev_flags) & FL_DUCKING)) Origin[2] += 36.0
        
else Origin[2] += 36.0
    
}
    
    
engfunc(EngFunc_SetOriginEntOrigin)
    
    
// Allow animation of sprite ?
    
if(TotalFrame && FrameRate 0.0)
    {
        
set_pev(Entpev_animtimeget_gametime())
        
set_pev(Entpev_framerateFrameRate 9.0)
        
        
set_pev(Entpev_spawnflagsSF_SPRITE_STARTON)
        
dllfunc(DLLFunc_SpawnEnt)
    }    
    
    
// Force Think
    
set_pev(Entpev_nextthinkget_gametime() + 0.05)


PHP Code:
switch(Rang[id]) { 
    case 
0: { 
        
//Do nothing, because 0 = unranked 
    

    case 
1: { 
            
Show_Attachment(idRankSprite[], 1.00.250.000
    } 
    
//... 

PHP Code:
public plugin_precache()
{
    for(new 
0sizeof(RankSprite); i++)
        
precache_model(RankSprite[i]) 
make sprites const
PHP Code:
new const RankSprite[2][] = 
{
    
"sprites/.spr",
    
"sprites/.spr"

__________________

Last edited by D3XT3R; 12-06-2017 at 03:02.
D3XT3R is offline
Send a message via Skype™ to D3XT3R
4ever16
Veteran Member
Join Date: Apr 2015
Old 12-26-2017 , 12:00   Re: Show rank sprite above head during freezetime
Reply With Quote #6

Quote:
Originally Posted by Airkish View Post
I just need a code how to set and unset sprites
Turn on plugin when round finish.
Turn off plugin after 10 seconds when round starts.
4ever16 is offline
Airkish
AlliedModders Donor
Join Date: Apr 2016
Location: Lithuania
Old 12-26-2017 , 15:06   Re: Show rank sprite above head during freezetime
Reply With Quote #7

Quote:
Originally Posted by 4ever16 View Post
Turn on plugin when round finish.
Turn off plugin after 10 seconds when round starts.
Dude you are telling me the obvious, I just need a part of code (2 functions for setting and unsetting sprites) I can do other myself.

Btw you don't do like you just said, You start on freezetime start and end (I think they call it new round or round start cant remember)
__________________
Airkish 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 11:16.


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