AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Zombie Plague Mod (https://forums.alliedmods.net/forumdisplay.php?f=126)
-   -   Subplugin Submission [ZP] Extra Item: Teleport v1.2 (https://forums.alliedmods.net/showthread.php?t=91797)

NiHiLaNTh 05-05-2009 15:30

[ZP] Extra Item: Teleport v1.2
 
1 Attachment(s)
Extra Item: Teleport.
Teams: Humans only.
Cost: 10 Ammo packs.

As the title says with this plugin you can buy and use teleport.You can use
teleport in all game modes.When you buy teleport you must bind a key to use it (bind "key" teleport)
and in-game press your teleport key and you will be automatically teleported at that place where you are aiming at.(Like in War3FT).You can use teleport 5 times per round(Editable by CVAR).
NOTE: Please, to avoid map bugs do not teleport to map sky
Changelog:
v1.0 - First Release
v1.1 - Added bind key...
v1.2 - Added: Effect from war3ft, cooldown.
CVARS:
zp_teleport_limit (default is 5) - How much times per round you can use teleport.
zp_teleport_cooldown (def is 10) - Cooldown time

TheKidz 05-05-2009 16:43

Re: [ZP] Extra Item: Teleport
 
i teste here, and everything is working,awesome plugin!
GJ! :D

Bummps 05-05-2009 21:53

Re: [ZP] Extra Item: Teleport
 
GJ ! +k
Dude, now i have a ideia...
I'll try make a albert wesker from RE5 with T-virus power...

Dude, i dont have "blinkarrival.wav", can you give me ? :/

NiHiLaNTh 05-06-2009 00:58

Re: [ZP] Extra Item: Teleport
 
1 Attachment(s)
Quote:

Originally Posted by Bummps (Post 822018)
GJ ! +k
Dude, now i have a ideia...
I'll try make a albert wesker from RE5 with T-virus power...

Dude, i dont have "blinkarrival.wav", can you give me ? :/

Yes, I can.

Bummps 05-06-2009 03:50

Re: [ZP] Extra Item: Teleport
 
We need a cvar for autobind key

Pach 05-06-2009 04:00

Re: [ZP] Extra Item: Teleport
 
NiHiLaNTh, Please make your fix
PHP Code:

//// zp_extra_teleport11.sma
// C:\Temp\Server\cstrike\addons\amxmodx\scripting\zp_extra_teleport11.sma(128)
warning 203symbol is never used"zp_round_started"
// Header size:            492 bytes
// Code size:             1660 bytes
// Data size:             1260 bytes
// Stack/heap size:      16384 bytes; estimated max. usage=41 cells (164 bytes)
// Total requirements:   19796 bytes
//
// 1 Warning.
// Done.
//
// Compilation Time: 5,07 sec
// ---------------------------------------- 


Bummps 05-06-2009 04:17

Re: [ZP] Extra Item: Teleport
 
I think frostnova.wav (frost nade's sound) is better than blinkarrival.wav and....

PHP Code:

/*   Changelog:
  v1.0 - First Release
  v1.1 - Added bind function.
 
 To use teleport bind a key.
 Example: bind "key" teleport. (bind f teleport)
 
 WARNING:To prevent bugs do not teleport to sky.
*/ 
 
#include <amxmodx>
#include <fun>
#include <zombieplague>
new const PLUGIN_NAME[] = "[ZP] Teleport"
new const PLUGIN_VERSION[] = "1.0"
new const PLUGIN_AUTHOR[] = "NiHiLaNTh"
// Item ID
new g_teleport;
// Game Variables
new bool:hasTeleport[33];
new 
teleport_counter;
// CVAR Pointer
new pcv_teleport_limit;
// Plugin Initialization
public plugin_init()
{
 
// Plugin Call
 
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR);
 
 
// Client Command
 
register_clcmd("teleport""ActivateTeleport");
 
 
// Register new extra item
 
g_teleport zp_register_extra_item("5 Teleports"10ZP_TEAM_HUMAN);
 
 
// CVAR
 
pcv_teleport_limit register_cvar("zp_teleport_limit""5");
}
// Precache Sound
public plugin_precache()
{
 
precache_sound("warcraft3/frostnova.wav");
}
 
// Player bought one of our items...
public zp_extra_item_selected(iditemid)
{
 if (
itemid == g_teleport)
 {
  if (
hasTeleport[id])
  {
   
client_print(idprint_chat"[ZP] You already have Teleport.");
   
hasTeleport[id] = false;
  }
  else
  {
   
hasTeleport[id] = true;
   
client_cmd(id"bind x ^"teleport^"")
   
client_print(idprint_chat"[ZP] Press X to Teleport");
  }
 }
}
// Activate Teleport
public ActivateTeleport(id)
{
 
// For some reason zombie or survivor has teleport
 
if (zp_get_user_zombie(id))
  return 
PLUGIN_CONTINUE;
 
 
// Check if player has bought teleport
 
if (!hasTeleport[id])
 {
  
client_print(idprint_center"[ZP] Buy Teleport first");
  return 
PLUGIN_CONTINUE;
 }
 
 
// Get old and new location
 
new OldLocation[3], NewLocation[3];
 
 
// Get current players location
 
get_user_origin(idOldLocation);
 
 
// Get location where player is aiming(where he will be teleported)
 
get_user_origin(idNewLocation3);
 
// Increase teleport counter
 
teleport_counter++
 
 
// Play needed sound
 
emit_sound(idCHAN_STATIC"warcraft3/frostnova.wav"VOL_NORMATTN_NORM0PITCH_NORM);
 
 
// Player cannot stuck in the wall/floor or ceiling
 
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(idNewLocation);
 
 
// 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;


/\ If you dont want lose your teleport when round start

OrbitaL 05-06-2009 05:52

Re: [ZP] Extra Item: Teleport
 
What about effects like in war3ft mod?

Pach 05-06-2009 05:56

Re: [ZP] Extra Item: Teleport
 
Quote:

Originally Posted by Bummps (Post 822098)
I think frostnova.wav (frost nade's sound) is better than blinkarrival.wav and....

PHP Code:

/*   Changelog:
  v1.0 - First Release
  v1.1 - Added bind function.
 
 To use teleport bind a key.
 Example: bind "key" teleport. (bind f teleport)
 
 WARNING:To prevent bugs do not teleport to sky.
*/ 
 
#include <amxmodx>
#include <fun>
#include <zombieplague>
new const PLUGIN_NAME[] = "[ZP] Teleport"
new const PLUGIN_VERSION[] = "1.0"
new const PLUGIN_AUTHOR[] = "NiHiLaNTh"
// Item ID
new g_teleport;
// Game Variables
new bool:hasTeleport[33];
new 
teleport_counter;
// CVAR Pointer
new pcv_teleport_limit;
// Plugin Initialization
public plugin_init()
{
 
// Plugin Call
 
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR);
 
 
// Client Command
 
register_clcmd("teleport""ActivateTeleport");
 
 
// Register new extra item
 
g_teleport zp_register_extra_item("5 Teleports"10ZP_TEAM_HUMAN);
 
 
// CVAR
 
pcv_teleport_limit register_cvar("zp_teleport_limit""5");
}
// Precache Sound
public plugin_precache()
{
 
precache_sound("warcraft3/frostnova.wav");
}
 
// Player bought one of our items...
public zp_extra_item_selected(iditemid)
{
 if (
itemid == g_teleport)
 {
  if (
hasTeleport[id])
  {
   
client_print(idprint_chat"[ZP] You already have Teleport.");
   
hasTeleport[id] = false;
  }
  else
  {
   
hasTeleport[id] = true;
   
client_cmd(id"bind x ^"teleport^"")
   
client_print(idprint_chat"[ZP] Press X to Teleport");
  }
 }
}
// Activate Teleport
public ActivateTeleport(id)
{
 
// For some reason zombie or survivor has teleport
 
if (zp_get_user_zombie(id))
  return 
PLUGIN_CONTINUE;
 
 
// Check if player has bought teleport
 
if (!hasTeleport[id])
 {
  
client_print(idprint_center"[ZP] Buy Teleport first");
  return 
PLUGIN_CONTINUE;
 }
 
 
// Get old and new location
 
new OldLocation[3], NewLocation[3];
 
 
// Get current players location
 
get_user_origin(idOldLocation);
 
 
// Get location where player is aiming(where he will be teleported)
 
get_user_origin(idNewLocation3);
 
// Increase teleport counter
 
teleport_counter++
 
 
// Play needed sound
 
emit_sound(idCHAN_STATIC"warcraft3/frostnova.wav"VOL_NORMATTN_NORM0PITCH_NORM);
 
 
// Player cannot stuck in the wall/floor or ceiling
 
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(idNewLocation);
 
 
// 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;


/\ If you dont want lose your teleport when round start

Has found out an error! It is possible to use a teleport not 5 times, and unlimited quantity :( correct only on 5 times for one round.

w5014560 05-06-2009 05:58

Re: [ZP] Extra Item: Teleport
 
more bug!,i testit .
butzp_teleport_limit Can not restrict buy and use .
and no Cooling time to next ues


All times are GMT -4. The time now is 16:51.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.