AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Team Icon Spr [1.0.5] [CSDM Supported] (https://forums.alliedmods.net/showthread.php?t=85200)

tuty 02-07-2009 06:57

Team Icon Spr [1.0.5] [CSDM Supported]
 
4 Attachment(s)
Team Icon Spr
v1.0.5

Description:

- Plugin was requested here :arrow: http://forums.alliedmods.net/showthread.php?t=85175
- Well, this plugin make a Team icon sprite up on your head when you type a command in chat ^^
- This plugin works in CS 1.6 and CZ

Commands:

- say /teamspr - make a sprite on your head
- say /delspr - delete the sprite if exists
- If
teamspr_mode is set to "2", the commands will be blocked.

Cvars:

-
teamspr_mode:

0 - plugin disabled
1 - players can activate/dezactivate the icon sprite
2 - on round start, all players will have icons up on head and can't be dezactivated with chat command, only changing cvar in 1 or 0.

- teamspr_sprite_time - 32767 (the time until sprite will be destroyed)


REUPDATED...

- Added support for csdm, optimised code, fixed some stuff (2015)


Recomandation's:

-
download the sprites archive and put the teamspr folder in sprites/ dir.
- put the teamspr.txt in data/lang dir.

Credits:

-
anakin_cstrike(for optimizations)


Images:

http://i42.tinypic.com/2j1tlvo.jpg http://i39.tinypic.com/29exyw.jpg

Added support for CSDM!


hleV 02-07-2009 07:02

Re: Team Icon Spr
 
Looks funny, although the code could be more optimized.

tuty 02-07-2009 07:11

Re: Team Icon Spr
 
updated a bit ;/

xPaw 02-07-2009 07:16

Re: Team Icon Spr
 
i suggest to do this like it done in Day Of Defeat, only your team will see this sprite, would be better

tuty 02-07-2009 07:17

Re: Team Icon Spr
 
i think is impossible :|

ConnorMcLeod 02-07-2009 07:26

Re: Team Icon Spr
 
Quote:

Originally Posted by tuty (Post 757285)
i think is impossible :|


message_begin(MSG_ALL, SVC_TEMPENTITY);

Possible with MSG_ONE_UNRELIABLE


You don't need to check is_user_connected if you have previously checked is_user_alive, also is_user_alive should return 0 with HLTVs

You misuse ResetHUD event.

crazyeffect 02-07-2009 08:04

Re: Team Icon Spr
 
Cool :D

anakin_cstrike 02-07-2009 08:14

Re: Team Icon Spr
 
PHP Code:

switch(get_user_team(id))
    {
        case 
1:
        {
            
write_short(g_t_red_spr);
        }
        case 
2:
        {
            
write_short(g_ct_blue_spr);
        }
    } 

->
PHP Code:

write_short( ( get_user_teamid )==1) ? g_t_red_spr g_ct_red_spr ); 

PHP Code:

public reset_hud()
{
    new 
id;
    for(
id 1id <= get_maxplayers(); id++) 

Cache the value in plugin_init, like this:
PHP Code:

new g_maxplayers;
// ..
public plugin_init() g_maxplayers get_maxplayers();

// and use like this
for(new id 1id <= g_maxplayersid++) 

Why ? because is not called at every loop

SnoW 02-07-2009 08:24

Re: Team Icon Spr
 
Quote:

Originally Posted by xPaw (Post 757283)
i suggest to do this like it done in Day Of Defeat, only your team will see this sprite, would be better

A possibility to use which one you want would be nice.

tuty 02-07-2009 09:11

Re: Team Icon Spr
 
Quote:

Originally Posted by ConnorMcLeod (Post 757292)
message_begin(MSG_ALL, SVC_TEMPENTITY);

Possible with MSG_ONE_UNRELIABLE


You don't need to check is_user_connected if you have previously checked is_user_alive, also is_user_alive should return 0 with HLTVs

You misuse ResetHUD event.


i tryed .. fatal error ^^ lol

EDIT: updated :)


All times are GMT -4. The time now is 01:21.

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