hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.05.17. 01:12



Jelenlévő felhasználók

Jelenleg 802 felhasználó van jelen :: 0 regisztrált, 0 rejtett és 802 vendég

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-kor tartózkodott itt.

Regisztrált felhasználók: nincs regisztrált felhasználó az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása  Hozzászólás a témához  [ 2 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: [ZP] Extra Item Teleport Fordítás.
HozzászólásElküldve: 2014.08.30. 18:29 
Offline
Senior Tag

Csatlakozott: 2013.05.22. 17:06
Hozzászólások: 205
Megköszönt másnak: 88 alkalommal
Sziasztok valaki le magyarosítaná.

Idézet:
/* Changelog:
#include <amxmodx>
#include <fun>
#include <zombieplague>

new const PLUGIN_NAME[] = ""
new const PLUGIN_VERSION[] = ""
new const PLUGIN_AUTHOR[] = ""

// Item ID
new g_teleport;

// Game Variables
new bool:hasTeleport[33];
new teleport_counter;
new Float:g_lastusetime[33];

// CVAR Pointers
new pcv_teleport_limit, pcv_teleport_cooldown;

// Sprite Index
new BubbleSprite;

// Plugin Initialization
public plugin_init()
{
// Plugin Call
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);

// Client Command
register_clcmd("teleport", "ActivateTeleport");

// Register new extra item
g_teleport = zp_register_extra_item("Teleport", 25, ZP_TEAM_HUMAN);

// CVARs
pcv_teleport_limit = register_cvar("zp_teleport_limit", "3");
pcv_teleport_cooldown = register_cvar("zp_teleport_cooldown", "10");
}

// Precache Files
public plugin_precache()
{
// Teleport Sound
precache_sound("warcraft3/new_teleport.wav");

// Sprite
BubbleSprite = precache_model("sprites/blueflare2.spr");
}

// New round started - remove all teleports
zp_round_started(gamemode, id)
{
// On round start client cannot have our extra item
if (hasTeleport[id])
return PLUGIN_CONTINUE;
}

// Player bought our item...
public zp_extra_item_selected(owner, itemid)
{
if (itemid == g_teleport)
{
if (hasTeleport[owner])
{
client_print(owner, print_center, "Already own this item.");
hasTeleport[owner] = false;
}
else
{
hasTeleport[owner] = true;
teleport_counter = 0;
client_print(owner, print_chat, "[ZP] To use teleport bind a key(bind f teleport)");
}
}
}

// Activate Teleport
public ActivateTeleport(id)
{
// For some reason zombie or survivor or nemesis has teleport
if (zp_get_user_zombie(id) || zp_get_user_survivor(id) || zp_get_user_nemesis(id))
return PLUGIN_CONTINUE;

// Check if player has bought teleport
if (!hasTeleport[id])
{
client_print(id, print_center, "Buy teleport first");
return PLUGIN_CONTINUE;
}

// Teleport cooldown not over
if (get_gametime() - g_lastusetime[id] < get_pcvar_float(pcv_teleport_cooldown))
{
client_print(id, print_center, "You must wait a bit.");
return PLUGIN_CONTINUE;
}

// Get old and new location
new OldLocation[3], NewLocation[3];

// Get current players location
get_user_origin(id, OldLocation);

// Get location where player is aiming(where he will be teleported)
get_user_origin(id, NewLocation, 3);

// Create bubbles in a place where player teleported
// First, get user origin
new UserOrigin[3];
get_user_origin(id, UserOrigin);

// Now create bubbles
new BubbleOrigin[3];
BubbleOrigin[0] = UserOrigin[0];
BubbleOrigin[1] = UserOrigin[1];
BubbleOrigin[2] = UserOrigin[2] + 40;

message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_SPRITETRAIL) // TE ID
write_coord(BubbleOrigin[0]) // Start Position X
write_coord(BubbleOrigin[1]) // Start Position Y
write_coord(BubbleOrigin[2]) // Start Position Z
write_coord(UserOrigin[0]) // End Position X
write_coord(UserOrigin[1]) // End Position Y
write_coord(UserOrigin[2]) // End Position Z
write_short(BubbleSprite) // Sprite Index
write_byte(30) // Count
write_byte(10) // Life
write_byte(1) // Scale
write_byte(50) // Velocity Along Vector
write_byte(10) // Rendomness of Velocity
message_end();

// Increase teleport counter
teleport_counter++

// Play needed sound
emit_sound(id, CHAN_STATIC, "warcraft3/blinkarrival.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM);

// Player cannot stuck in the wall/floor
NewLocation[0] += ((NewLocation[0] - OldLocation[0] > 0) ? -50 : 50);
NewLocation[1] += ((NewLocation[1] - OldLocation[1] > 0) ? -50 : 50);
NewLocation[2] += 40;

// Teleport player
set_user_origin(id, NewLocation);

// Set current teleport use time
g_lastusetime[id] = get_gametime();

// Check if user has reached limit
new teleport_limit = get_pcvar_num(pcv_teleport_limit);
if (teleport_counter == teleport_limit)
{
hasTeleport[id] = false;
}

return PLUGIN_CONTINUE;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/

_________________
Ha, segítettél mindig meg köszönöm!
De ha, segítettem köszönd meg Te is ! LIKE


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: [ZP] Extra Item Teleport Fordítás.
HozzászólásElküldve: 2014.09.03. 00:20 
Offline
Fanatikus
Avatar

Csatlakozott: 2014.08.21. 19:30
Hozzászólások: 182
Megköszönt másnak: 3 alkalommal
Megköszönték neki: 41 alkalommal
Szia!

Tessék:

SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <fun>
  3. #include <zombieplague>
  4.  
  5. new const PLUGIN_NAME[] = ""
  6. new const PLUGIN_VERSION[] = ""
  7. new const PLUGIN_AUTHOR[] = ""
  8.  
  9. // Item ID
  10. new g_teleport;
  11.  
  12. // Game Variables
  13. new bool:hasTeleport[33];
  14. new teleport_counter;
  15. new Float:g_lastusetime[33];
  16.  
  17. // CVAR Pointers
  18. new pcv_teleport_limit, pcv_teleport_cooldown;
  19.  
  20. // Sprite Index
  21. new BubbleSprite;
  22.  
  23. // Plugin Initialization
  24. public plugin_init()
  25. {
  26. // Plugin Call
  27. register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
  28.  
  29. // Client Command
  30. register_clcmd("teleport", "TeleportAktivalasa");
  31.  
  32. // Register new extra item
  33. g_teleport = zp_register_extra_item("Teleport", 25, ZP_TEAM_HUMAN);
  34.  
  35. // CVARs
  36. pcv_teleport_limit = register_cvar("zp_teleport_limit", "3");
  37. pcv_teleport_cooldown = register_cvar("zp_teleport_cooldown", "10");
  38. }
  39.  
  40. // Precache Files
  41. public plugin_precache()
  42. {
  43. // Teleport Sound
  44. precache_sound("warcraft3/new_teleport.wav");
  45.  
  46. // Sprite
  47. BubbleSprite = precache_model("sprites/blueflare2.spr");
  48. }
  49.  
  50. // New round started - remove all teleports
  51. zp_round_started(gamemode, id)
  52. {
  53. // On round start client cannot have our extra item
  54. if (hasTeleport[id])
  55. return PLUGIN_CONTINUE;
  56. }
  57.  
  58. // Player bought our item...
  59. public zp_extra_item_selected(owner, itemid)
  60. {
  61. if (itemid == g_teleport)
  62. {
  63. if (hasTeleport[owner])
  64. {
  65. client_print(owner, print_center, "Mar van ilyen tetel.");
  66. hasTeleport[owner] = false;
  67. }
  68. else
  69. {
  70. hasTeleport[owner] = true;
  71. teleport_counter = 0;
  72. client_print(owner, print_chat, "[ZP] Teleport hasznalatahoz, konzolba: bind f teleport");
  73. }
  74. }
  75. }
  76.  
  77. // Activate Teleport
  78. public ActivateTeleport(id)
  79. {
  80. // For some reason zombie or survivor or nemesis has teleport
  81. if (zp_get_user_zombie(id) || zp_get_user_survivor(id) || zp_get_user_nemesis(id))
  82. return PLUGIN_CONTINUE;
  83.  
  84. // Check if player has bought teleport
  85. if (!hasTeleport[id])
  86. {
  87. client_print(id, print_center, "Vegyel teleportot elsonek!");
  88. return PLUGIN_CONTINUE;
  89. }
  90.  
  91. // Teleport cooldown not over
  92. if (get_gametime() - g_lastusetime[id] < get_pcvar_float(pcv_teleport_cooldown))
  93. {
  94. client_print(id, print_center, "Varj meg egy kicsit");
  95. return PLUGIN_CONTINUE;
  96. }
  97.  
  98. // Get old and new location
  99. new OldLocation[3], NewLocation[3];
  100.  
  101. // Get current players location
  102. get_user_origin(id, OldLocation);
  103.  
  104. // Get location where player is aiming(where he will be teleported)
  105. get_user_origin(id, NewLocation, 3);
  106.  
  107. // Create bubbles in a place where player teleported
  108. // First, get user origin
  109. new UserOrigin[3];
  110. get_user_origin(id, UserOrigin);
  111.  
  112. // Now create bubbles
  113. new BubbleOrigin[3];
  114. BubbleOrigin[0] = UserOrigin[0];
  115. BubbleOrigin[1] = UserOrigin[1];
  116. BubbleOrigin[2] = UserOrigin[2] + 40;
  117.  
  118. message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  119. write_byte(TE_SPRITETRAIL) // TE ID
  120. write_coord(BubbleOrigin[0]) // Start Position X
  121. write_coord(BubbleOrigin[1]) // Start Position Y
  122. write_coord(BubbleOrigin[2]) // Start Position Z
  123. write_coord(UserOrigin[0]) // End Position X
  124. write_coord(UserOrigin[1]) // End Position Y
  125. write_coord(UserOrigin[2]) // End Position Z
  126. write_short(BubbleSprite) // Sprite Index
  127. write_byte(30) // Count
  128. write_byte(10) // Life
  129. write_byte(1) // Scale
  130. write_byte(50) // Velocity Along Vector
  131. write_byte(10) // Rendomness of Velocity
  132. message_end();
  133.  
  134. // Increase teleport counter
  135. teleport_counter++
  136.  
  137. // Play needed sound
  138. emit_sound(id, CHAN_STATIC, "warcraft3/blinkarrival.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
  139.  
  140. // Player cannot stuck in the wall/floor
  141. NewLocation[0] += ((NewLocation[0] - OldLocation[0] > 0) ? -50 : 50);
  142. NewLocation[1] += ((NewLocation[1] - OldLocation[1] > 0) ? -50 : 50);
  143. NewLocation[2] += 40;
  144.  
  145. // Teleport player
  146. set_user_origin(id, NewLocation);
  147.  
  148. // Set current teleport use time
  149. g_lastusetime[id] = get_gametime();
  150.  
  151. // Check if user has reached limit
  152. new teleport_limit = get_pcvar_num(pcv_teleport_limit);
  153. if (teleport_counter == teleport_limit)
  154. {
  155. hasTeleport[id] = false;
  156. }
  157.  
  158. return PLUGIN_CONTINUE;
  159. }
  160. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  161. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
  162. */


UI: Kommenteket (//) nem fordítottam, azok nem lényegesek. :)


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése:  Rendezés  
Új téma nyitása  Hozzászólás a témához  [ 2 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 1 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole