hlmod.hu
https://hlmod.hu/

Spaka
https://hlmod.hu/viewtopic.php?f=9&t=17905
Oldal: 1 / 1

Szerző:  AsD# [ 2014.11.01. 20:31 ]
Hozzászólás témája:  Spaka

Hogylehet berakni egy sapkat hogy mindenkit az legyen?
Ha plugin kell akk belinkelnévalaki?

Szerző:  MeSter [ 2014.11.01. 20:41 ]
Hozzászólás témája:  Re: Spaka

Ez alapján meg tudod csinálni ha nem megy segítek :)

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/sapi_te.mdl",
  9. "models/sapi_ct.mdl",
  10. ""
  11. };
  12.  
  13. new g_iHats[ 33 ];
  14.  
  15. public plugin_init( ) {
  16. register_plugin( "Sapka", "1.3", "xPaw" );
  17.  
  18. register_cvar( "sapi", "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_T ] );
  28. precache_model( g_szHatModel[ CS_TEAM_CT ] );
  29. }
  30.  
  31. public client_disconnect( id )
  32. if( is_valid_ent( g_iHats[ id ] ) )
  33. remove_entity( g_iHats[ id ] );
  34.  
  35. public FwdHamPlayerSpawn( const id ) {
  36. if( is_user_alive( id ) ) {
  37. new iEntity = g_iHats[ id ];
  38.  
  39. if( !is_valid_ent( iEntity ) ) {
  40. if( !( iEntity = g_iHats[ id ] = create_entity( "info_target" ) ) )
  41. return;
  42.  
  43. new CsTeams:iTeam = cs_get_user_team( id );
  44.  
  45. if( iTeam != CS_TEAM_T && iTeam != CS_TEAM_CT )
  46. iTeam = CS_TEAM_T;
  47.  
  48. entity_set_model( iEntity, g_szHatModel[ iTeam ] );
  49. entity_set_int( iEntity, EV_INT_movetype, MOVETYPE_FOLLOW );
  50. entity_set_edict( iEntity, EV_ENT_aiment, id );
  51. }
  52. }
  53. }
  54.  
  55. public EventTeamInfo( ) {
  56. new id = read_data( 1 ), iEntity = g_iHats[ id ];
  57.  
  58. if( !is_valid_ent( iEntity ) ) {
  59. if( iEntity > 0 )
  60. g_iHats[ id ] = 0;
  61.  
  62. return;
  63. }
  64.  
  65. new szTeam[ 2 ];
  66. read_data( 2, szTeam, 1 );
  67.  
  68. if( szTeam[ 0 ] == 'C' )
  69. entity_set_model( iEntity, g_szHatModel[ CS_TEAM_CT ] );
  70. else
  71. entity_set_model( iEntity, g_szHatModel[ CS_TEAM_T ] );
  72. }

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