hlmod.hu
https://hlmod.hu/

Sprite
https://hlmod.hu/viewtopic.php?f=29&t=4296
Oldal: 1 / 3

Szerző:  fuck604 [2012.05.03. 19:08 ]
Hozzászólás témája:  Sprite

Üdv! Mostmár én is kérek 1 plugint:)
Az lenne a lényege hogy a fregeket spriteba oda írja ahol a bomba szokott lenni ha lehet ez elgyen az RGB kódja:
Kód:
000 255 100

Szerző:  tson_ [2012.05.03. 19:11 ]
Hozzászólás témája:  Re: Sprite

fuck604 írta:
ahol a bomba szokott lenni

Úgy érted, hogy A-n vagy B-n? :geek:
[spoiler]:twisted:[/spoiler]

Szerző:  fuck604 [2012.05.03. 19:12 ]
Hozzászólás témája:  Re: Sprite

Nem shop, bomba spritera gonolok a képernyőn

Szerző:  kiki [2012.05.03. 19:22 ]
Hozzászólás témája:  Re: Sprite

shop? Milyen shop?


Amm ha bal oldalra gondolsz azt nem lehet megcsinalni

Szerző:  fuck604 [2012.05.03. 19:46 ]
Hozzászólás témája:  Re: Sprite

igen arra gondolok és meg lehet mert láttam 1 szerón :)
up:
ez a plugin h rakja oda?
Kód:
#include <amxmodx>

#define PLUGIN "Weapon Icon Blue"
#define VERSION "1.2"
#define AUTHOR "hoboman313/Zenix"

#define MAX_PLAYERS 32

new iconstatus, pcv_iloc
new user_icons
[MAX_PLAYERS+1][16]


public plugin_init() 
{
   register_plugin(PLUGIN, VERSION, AUTHOR)
   
   register_event
("CurWeapon", "update_icon", "be", "1=1")
   register_event("AmmoX", "draw_icon", "be")
   register_event("DeathMsg", "event_death", "a")
   
   pcv_iloc 
= register_cvar("amx_weapon_location", "1")
   
   check_icon_loc
()
}

public update_icon(id) 
{
   remove_weapon_icon(id)
   
   check_icon_loc
()
      
   if
( get_pcvar_num(pcv_iloc) == 0 || is_user_bot(id) )
      return
      
   static sprite
[16], iwpn, clip, ammo

   iwpn 
= get_user_weapon(id, clip, ammo)
   
   switch
(iwpn) 
   
{
      case CSW_P228: 
      sprite 
= "d_p228"
      case CSW_SCOUT: 
      sprite 
= "d_scout"
      case CSW_HEGRENADE: 
      sprite 
= "d_grenade"
      case CSW_XM1014:
      sprite = "d_xm1014"
      case CSW_MAC10: 
      sprite 
= "d_mac10"
      case CSW_AUG: 
      sprite 
= "d_aug"
      case CSW_SMOKEGRENADE: 
      sprite 
= "d_flashbang"
      case CSW_ELITE: 
      sprite 
= "d_elite"
      case CSW_FIVESEVEN: 
      sprite 
= "d_fiveseven"
      case CSW_UMP45: 
      sprite 
= "d_ump45"
      case CSW_SG550: 
      sprite 
= "d_sg550"
      case CSW_GALIL: 
      sprite 
= "d_galil"
      case CSW_FAMAS: 
      sprite 
= "d_famas"
      case CSW_USP: 
      sprite 
= "d_usp"
      case CSW_MP5NAVY: 
      sprite 
= "d_mp5navy"
      case CSW_M249: 
      sprite 
= "d_m249"
      case CSW_M3: 
      sprite 
= "d_m3"
      case CSW_M4A1: 
      sprite 
= "d_m4a1"
      case CSW_TMP: 
      sprite 
= "d_tmp"
      case CSW_G3SG1: 
      sprite 
= "d_g3sg1"
      case CSW_FLASHBANG:
      sprite = "d_flashbang"
      case CSW_DEAGLE: 
      sprite 
= "d_deagle"
      case CSW_SG552: 
      sprite 
= "d_sg552"
      case CSW_AK47: 
      sprite 
= "d_ak47"
      case CSW_KNIFE: 
      sprite 
= "d_knife"
      case CSW_P90: 
      sprite 
= "d_p90"
      case CSW_GLOCK18: 
      sprite 
= "d_glock18"
      case CSW_AWP: 
      sprite 
= "d_awp"
      default: 
      return
   
}   
   user_icons
[id] = sprite
   
   draw_icon
(id)
   
   return
} 


public draw_icon
(id)
{
   static iwpn, clip, ammo, icon_color[3]
   
   iwpn 
= get_user_weapon(id, clip, ammo)
   
   
// ammo check, this is for the color of the icon
   if ((ammo == 0 && clip == 0))
      icon_color = {255, 0, 0} // outta ammo!
   else if ( ammo==&& iwpn!=CSW_KNIFE)
      icon_color = {255, 160, 0} // last clip!
   else 
      icon_color 
= {0, 0, 160}//green icon...decent ammo
   
   
   
// draw the sprite itself
   message_begin(MSG_ONE,iconstatus,{0,0,0},id)
   write_byte(1) // status (0=hide, 1=show, 2=flash)
   write_string(user_icons[id]) // sprite name
   write_byte(icon_color[0]) // red
   write_byte(icon_color[1]) // green
   write_byte(icon_color[2]) // blue
   message_end()
}


public remove_weapon_icon(id) 
{
   message_begin(MSG_ONE,iconstatus,{0,0,0},id)
   write_byte(0)
   write_string(user_icons[id])
   message_end()
}


public event_death() 
{
   new id = read_data(2) // the dead player's ID (1-32)
   
   if 
(!is_user_bot(id)) 
      remove_weapon_icon
(id) 
}


public check_icon_loc() 
{
   new value = get_pcvar_num(pcv_iloc)
   
   if 
(value == 1)
      iconstatus = get_user_msgid("StatusIcon")
   else if (value == 2)
      iconstatus = get_user_msgid("Scenario")
   else
      iconstatus 
= 0
   
   return PLUGIN_CONTINUE
}


Szerző:  kiki [2012.05.03. 19:52 ]
Hozzászólás témája:  Re: Sprite

pMbe ipt, valamelyik nap majd meglesem

Szerző:  CeDee [2012.05.07. 16:37 ]
Hozzászólás témája:  Re: Sprite

Kép
Így?

Szerző:  kiki [2012.05.07. 16:39 ]
Hozzászólás témája:  Re: Sprite

Mondtam megcsinálom, offtopicba kértem sprites.txt tartalmát is de nem válaszolt, gondolom már nemkell neki!

Szerző:  fuck604 [2012.05.07. 16:51 ]
Hozzászólás témája:  Re: Sprite

Tőlem kérted? Mostanában nem nagyon olvasom. Milyen sprites.txt kellene?

Szerző:  VirTuaL ~` [2012.05.07. 17:40 ]
Hozzászólás témája:  Re: Sprite

Kód:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

new sync,frags[33],blink[33],show_hfc[33],on,on_kill,fcolor,fmin,fmax,blink_cvar,blink_time
public plugin_init() {
   register_plugin("HUD Frag Counter", "1.2", "<VeCo>")
   register_cvar("hfc_version","1.2",FCVAR_SERVER | FCVAR_SPONLY)
   on = register_cvar("hfc_on","1")
   on_kill = register_cvar("hfc_show_only_on_kill","0")
   blink_cvar = register_cvar("hfc_blink","1")
   blink_time = register_cvar("hfc_blink_time","2.0")
   fcolor = register_cvar("hfc_color","0 255 0")
   fmin = register_cvar("hfc_min_frags","3")
   fmax = register_cvar("hfc_max_frags","10")
   
   RegisterHam(Ham_Spawn,"player","event_spawn",1)
   register_forward(FM_PlayerPreThink,"player_think")
   register_event("DeathMsg","hook_death","a")
   sync = CreateHudSyncObj()
}

public event_spawn(id)
{
   if(!get_pcvar_num(on) || !is_user_alive(id)) return
   frags[id] = 0
}

public player_think(id)
{
   if(!get_pcvar_num(on) || !is_user_alive(id) || frags[id] < get_pcvar_num(fmin)) return
   
   new color[17],red[5],green[7],blue[5]
   get_pcvar_string(fcolor,color,16)
   parse(color,red,4,green,6,blue,4)
   
   if(!get_pcvar_num(on_kill))
   {
      set_hudmessage(str_to_num(red), str_to_num(green), str_to_num(blue), -1.0, 0.45, blink[id], 6.0, 0.1,0.1,0.2,-1)
      ShowSyncHudMsg(id,sync,"%i",frags[id])
   } else {
      if(show_hfc[id])
      {
         set_hudmessage(str_to_num(red), str_to_num(green), str_to_num(blue), -1.0, 0.45, blink[id], 6.0, 0.1,0.1,0.2,-1)
         ShowSyncHudMsg(id,sync,"%i",frags[id])
      }
   }
}

public hook_death()
{
   new killer = read_data(1)
   new victim = read_data(2)
   
   if(!get_pcvar_num(on) || get_user_userid(killer) == get_user_userid(victim)) return
   if(frags[killer] < get_pcvar_num(fmax)) frags[killer]++
   
   if(get_pcvar_num(blink_cvar))
   {
      blink[killer] = 1
      set_task(get_pcvar_float(blink_time),"remove_blink",killer)
   }
   
   if(get_pcvar_num(on_kill))
   {
      show_hfc[killer] = true
      set_task(get_pcvar_float(blink_time),"remove_hfc",killer)
   }
}

public remove_blink(id)
{
   if(!is_user_connected(id)) return
   blink[id] = 0
}

public remove_hfc(id)
{
   if(!is_user_connected(id)) return
   show_hfc[id] = false
}

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