hlmod.hu
https://hlmod.hu/

Sapka
https://hlmod.hu/viewtopic.php?f=10&t=18297
Oldal: 1 / 1

Szerző:  lili [ 2014.11.30. 12:52 ]
Hozzászólás témája:  Sapka

Sziasztok, ebbe átírná valaki, hogy csak a CTk kapjanak sapkát?

Mikulás Sapka [2mdl]

Köszönöm

Szerző:  Beckx [ 2014.11.30. 14:40 ]
Hozzászólás témája:  Re: Sapka

Próbáld!

SMA Forráskód: [ Mindet kijelol ]
  1. #include < amxmodx >
  2. #include < engine >
  3. #include < cstrike >
  4. #include < hamsandwich >
  5.  
  6. new const g_szHatModel[ CsTeams ][ ] = {
  7. "",
  8. "models/santahat.mdl",
  9. "models/santahat_blue.mdl",
  10. ""
  11. };
  12.  
  13. new g_iHats[ 33 ];
  14.  
  15. public plugin_init( ) {
  16. register_plugin( "Team Santa Hat", "1.3", "xPaw" );
  17.  
  18. register_cvar( "santa_hat", "1.3", FCVAR_SERVER );
  19.  
  20. register_event( "TeamInfo", "EventTeamInfo", "a" );
  21.  
  22. RegisterHam( Ham_Spawn, "player", "FwdHamPlayerSpawn", 1 );
  23. }
  24.  
  25. public plugin_precache( ) {
  26.  
  27. precache_model( g_szHatModel[ CS_TEAM_CT ] );
  28. }
  29.  
  30. public client_disconnect( id )
  31. if( is_valid_ent( g_iHats[ id ] ) )
  32. remove_entity( g_iHats[ id ] );
  33.  
  34. public FwdHamPlayerSpawn( const id ) {
  35. if( is_user_alive( id ) ) {
  36. new iEntity = g_iHats[ id ];
  37.  
  38. if( !is_valid_ent( iEntity ) ) {
  39. if( !( iEntity = g_iHats[ id ] = create_entity( "info_target" ) ) )
  40. return;
  41.  
  42. new CsTeams:iTeam = cs_get_user_team( id );
  43.  
  44. if( iTeam != CS_TEAM_CT )
  45.  
  46. entity_set_model( iEntity, g_szHatModel[ iTeam ] );
  47. entity_set_int( iEntity, EV_INT_movetype, MOVETYPE_FOLLOW );
  48. entity_set_edict( iEntity, EV_ENT_aiment, id );
  49. }
  50. }
  51. }
  52.  
  53. public EventTeamInfo( ) {
  54. new id = read_data( 1 ), iEntity = g_iHats[ id ];
  55.  
  56. if( !is_valid_ent( iEntity ) ) {
  57. if( iEntity > 0 )
  58. g_iHats[ id ] = 0;
  59.  
  60. return;
  61. }
  62.  
  63. new szTeam[ 2 ];
  64. read_data( 2, szTeam, 1 );
  65.  
  66. if( szTeam[ 0 ] == 'C' )
  67. entity_set_model( iEntity, g_szHatModel[ CS_TEAM_CT ] );
  68. }

Szerző:  lili [ 2014.11.30. 18:41 ]
Hozzászólás témája:  Re: Sapka

Nem jó :(
Valami shuttingal kidobb mindenkit

Szerző:  Metal [ 2014.12.09. 11:26 ]
Hozzászólás témája:  Re: Sapka

Kell még 1 precache sor:

Kód:
precache_model( g_szHatModel[ CS_TEAM_T ] );

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/