Dabar yra 2019 Rgp 21 13:14




 Puslapis 11 [ 2 pranešimai(ų) ] 
Autorius Žinutė
 Pranešimo tema: 3D vaizdas
Žinutės numeris: #1  StandartinėParašytas: 2010 Rgs 05 19:11 
Flooderis arba specialistas
Vartotojo avataras

Užsiregistravo: 2010 Rgs 04 08:45
Pranešimai: 736
Karma: 18
Kodėl kai baigi healintis (arba nutrauki healinima) lieka 3d vaizdas?

  1.  
  2. public FwdCmdStartas(client, uc_handle, seed)
  3. {
  4. if( !(1 <= client <= g_iMaxPlayers) || !is_user_alive(client) || g_being_healed[client] || get_user_team(client) == 1 ) return FMRES_IGNORED;
  5.  
  6. new button = get_uc(uc_handle, UC_Buttons);
  7. new oldbuttons = pev(client, pev_oldbuttons);
  8. static target, body;
  9. new Float:dist = get_user_aiming(client, target, body);
  10. static Float: Time;
  11. Time = get_gametime();
  12.  
  13. new model[33];
  14. pev(client, pev_viewmodel2, model, 32);
  15.  
  16. if ( !g_being_healed[client] )
  17. {
  18.     if( (button & IN_USE) && !(oldbuttons & IN_USE) && dist < HEALING_DISTANCE )
  19.     {
  20.         if( (1 <= target <= g_iMaxPlayers) && is_user_alive(target) && !g_being_healed[target] && !g_healing[target] && Time - MEDIC_HEAL_COOLDOWN > g_LastHeal[client] && get_user_team(client) == get_user_team(target) )
  21.         {
  22.             static name[32] ; get_user_name(target, name, charsmax(name));
  23.             static name2[32] ; get_user_name(client, name2, charsmax(name2));
  24.             client_print(client, print_center, "Your target: %s", name);
  25.             client_print(target, print_center, "Your healer: %s", name2);
  26.             set_view(target, CAMERA_3RDPERSON)
  27.             set_view(client, CAMERA_3RDPERSON)
  28.            
  29.             emit_sound(target, CHAN_ITEM, g_medkit_heal, 1.0, ATTN_NORM, 0, PITCH_NORM);
  30.            
  31.            
  32.             g_healing_teammate[client] = true
  33.             g_healing[client] = true;
  34.             g_target[client] = target;
  35.            
  36.             g_being_healed[target] = true;
  37.            
  38.             ManageBar(client, HEAL_TIME);
  39.             ManageBar(target, HEAL_TIME);
  40.            
  41.             set_task(float(HEAL_TIME), "TaskFinishHeal", client);
  42.            
  43.             g_LastHeal[client] = Time
  44.         }
  45.     }
  46.     else if( g_healing[client] && !(button & IN_USE) )
  47.     {
  48.         new targeti = g_target[client];
  49.        
  50.         g_healing[client] = false;
  51.        
  52.         g_being_healed[targeti] = false;
  53.        
  54.         ManageBar(client, BAR_REMOVE);
  55.         ManageBar(targeti, BAR_REMOVE);
  56.        
  57.         remove_task(client);
  58.     }
  59.     if( (button & IN_USE) && !(oldbuttons & IN_USE) )
  60.     {
  61.         if(!g_being_healed[client] && !g_healing[client] && Time - MEDIC_HEAL_COOLDOWN > g_LastHeal[client] )
  62.         {
  63.             emit_sound(client, CHAN_ITEM, g_medkit_heal, 1.0, ATTN_NORM, 0, PITCH_NORM);
  64.            
  65.             g_healing_teammate[client] = false;
  66.             g_healing[client] = true;
  67.            
  68.             if ( !(button & IN_JUMP) && !(button & IN_DUCK) && !(button & IN_FORWARD) && !(button & IN_BACK) &&
  69.             !(button & IN_MOVELEFT) && !(button & IN_MOVERIGHT) && !(button & IN_ATTACK) && !(button & IN_ATTACK2))
  70.         {
  71.             client_print(client,  print_center, "Healing Self");
  72.             set_view(client, CAMERA_3RDPERSON)
  73.            
  74.         }
  75.         ManageBar(client, HEAL_TIME);
  76.        
  77.         set_task(float(HEAL_TIME), "TaskFinishHeal2", client);
  78.        
  79.         g_LastHeal[client] = Time
  80.     }
  81. }
  82. else if ( g_healing[client] && !(button & IN_USE) )
  83. {
  84.     g_healing[client] = false;
  85.    
  86.     ManageBar(client, BAR_REMOVE);
  87.    
  88.     remove_task(client);
  89. }
  90. if ( g_healing[client] )
  91. {
  92.     if ( g_healing_teammate[client] && dist > HEALING_DISTANCE )
  93.     {
  94.         new targeti = g_target[client];
  95.        
  96.         g_healing[client] = false;
  97.        
  98.         g_being_healed[targeti] = false;
  99.        
  100.         ManageBar(client, BAR_REMOVE);
  101.         ManageBar(targeti, BAR_REMOVE);
  102.        
  103.         remove_task(client);
  104.     }
  105.     if ( !g_healing_teammate[client] )
  106.     {
  107.         if ( (button & IN_JUMP) || (button & IN_DUCK) || (button & IN_FORWARD) || (button & IN_BACK) ||
  108.         (button & IN_MOVELEFT) || (button & IN_MOVERIGHT) || (button & IN_ATTACK) || (button & IN_ATTACK2))
  109.     {
  110.         g_healing[client] = false;
  111.        
  112.         ManageBar(client, BAR_REMOVE);
  113.        
  114.         remove_task(client);
  115.     }
  116. }
  117. }
  118. }
  119.  
  120. return FMRES_IGNORED;
  121. }
  122.  
  123.  
  124.  
  125. public TaskFinishHeal(client)
  126. {
  127. if( pev_valid(g_ent[client]) )
  128. {
  129. remove_entity( g_ent[client] );
  130. g_ent[client] = 0;
  131. }
  132.  
  133. new target = g_target[client];
  134.  
  135. new health;
  136. health = get_user_health(target)
  137. static name[32] ; get_user_name(client, name, charsmax(name));
  138.  
  139. if ( health < 100)
  140. {
  141. set_user_health(target, 100);
  142. set_view(target, CAMERA_NONE)      
  143. }
  144.  
  145. if( g_human[target] && SurvivorClass[target] == 0)
  146. {
  147. emit_sound(target, CHAN_ITEM, bill_healed[random_num(0,sizeof bill_healed-1)], 1.0, ATTN_NORM, 0, PITCH_NORM);
  148. }
  149.  
  150. if( g_human[target] && SurvivorClass[target] == 1)
  151. {
  152. emit_sound(target, CHAN_ITEM, louis_healed[random_num(0,sizeof louis_healed-1)], 1.0, ATTN_NORM, 0, PITCH_NORM);
  153. }
  154.  
  155. if( g_human[target] && SurvivorClass[target] == 2)
  156. {
  157. emit_sound(target, CHAN_ITEM, zoey_healed[random_num(0,sizeof zoey_healed-1)], 1.0, ATTN_NORM, 0, PITCH_NORM);
  158. }
  159.  
  160. if( g_human[target] && SurvivorClass[target] == 3)
  161. {
  162. emit_sound(target, CHAN_ITEM, francis_healed[random_num(0,sizeof francis_healed-1)], 1.0, ATTN_NORM, 0, PITCH_NORM);
  163. }
  164.  
  165. ManageBar(client, BAR_REMOVE);
  166. ManageBar(target, BAR_REMOVE);
  167.  
  168. g_healing[client] = false;
  169.  
  170. g_being_healed[target] = false;
  171. }
  172.  
  173. public TaskFinishHeal2(client)
  174. {
  175. if( !(1 <= client <= g_iMaxPlayers) ) return PLUGIN_CONTINUE;
  176.  
  177. new health;
  178. health = get_user_health(client)
  179.  
  180. if ( health < 100)
  181. {
  182. set_view(client, CAMERA_NONE)   
  183. set_user_health(client, 100);
  184. }
  185.  
  186. if( g_human[client] && SurvivorClass[client] == 0)
  187. {
  188. emit_sound(client, CHAN_ITEM, bill_healed[random_num(0,sizeof bill_healed-1)], 1.0, ATTN_NORM, 0, PITCH_NORM);
  189. set_view(client, CAMERA_NONE)   
  190. }
  191.  
  192. if( g_human[client] && SurvivorClass[client] == 1)
  193. {
  194. emit_sound(client, CHAN_ITEM, louis_healed[random_num(0,sizeof louis_healed-1)], 1.0, ATTN_NORM, 0, PITCH_NORM);
  195. set_view(client, CAMERA_NONE)   
  196. }
  197.  
  198. if( g_human[client] && SurvivorClass[client] == 2)
  199. {
  200. emit_sound(client, CHAN_ITEM, zoey_healed[random_num(0,sizeof zoey_healed-1)], 1.0, ATTN_NORM, 0, PITCH_NORM);
  201. set_view(client, CAMERA_NONE)   
  202. }
  203.  
  204. if( g_human[client] && SurvivorClass[client] == 3)
  205. {
  206. emit_sound(client, CHAN_ITEM, francis_healed[random_num(0,sizeof francis_healed-1)], 1.0, ATTN_NORM, 0, PITCH_NORM);
  207. set_view(client, CAMERA_NONE)   
  208. }
  209.  
  210. ManageBar(client, BAR_REMOVE);
  211.  
  212. g_healing[client] = false;
  213.  
  214. return PLUGIN_CONTINUE;
  215. }
  216.  
  217. ResetItems(client)
  218. {
  219. if( !(1 <= client <= g_iMaxPlayers) ) return;
  220.  
  221. if( pev_valid(g_ent[client]) )
  222. {
  223. engfunc(EngFunc_RemoveEntity, g_ent[client]);
  224. g_ent[client] = 0;
  225. }      
  226.  
  227. if( g_being_healed[client] )
  228. {
  229. new target = g_target[client];
  230.  
  231. g_being_healed[target] = false;
  232.  
  233. g_healing[client] = false;
  234.  
  235. ManageBar(client, BAR_REMOVE);
  236. ManageBar(target, BAR_REMOVE);
  237. }
  238.  
  239. if( g_healing[client] )
  240. {
  241. new target = g_target[client];
  242.  
  243. g_healing[client] = false;
  244.  
  245. g_being_healed[target] = false;
  246.  
  247. ManageBar(client, BAR_REMOVE);
  248. ManageBar(target, BAR_REMOVE);
  249. }
  250. }
  251.  


Atsijungęs
 Aprašymas  
 
 Pranešimo tema: Re: 3D vaizdas
Žinutės numeris: #2  StandartinėParašytas: 2010 Rgs 05 19:35 
Flooderis arba specialistas
Vartotojo avataras

Užsiregistravo: 2010 Rgs 02 15:47
Pranešimai: 660
Karma: 31
Pamėgink dadėti:

  1. if ((button & !IN_USE) && !(oldbuttons & !IN_USE) )
  2. {
  3.          set_view(client, CAMERA_NONE)
  4.          set_view(target, CAMERA_NONE)
  5. }


Atsijungęs
 Aprašymas  
 
Rodyti paskutinius pranešimus:  Rūšiuoti pagal  
 Puslapis 11 [ 2 pranešimai(ų) ] 


Dabar prisijungę

Vartotojai naršantys šį forumą: Registruotų vartotojų nėra ir 1 svečias


Jūs negalite kurti naujų temų šiame forume
Jūs negalite atsakinėti į temas šiame forume
Jūs negalite redaguoti savo pranešimų šiame forume
Jūs negalite trinti savo pranešimų šiame forume
Jūs negalite prikabinti failų šiame forume

Ieškoti:
Pereiti į:  

cron