Raised This Month: $32 Target: $400
 8% 

Subplugin Submission [ZP] Extra Item: Teleport v1.2


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 05-05-2009 , 15:30   [ZP] Extra Item: Teleport v1.2
Reply With Quote #1

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
Attached Files
File Type: sma Get Plugin or Get Source (zp_extra_teleport12.sma - 5483 views - 4.5 KB)

Last edited by NiHiLaNTh; 05-06-2009 at 11:07.
NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
TheKidz
Senior Member
Join Date: May 2009
Old 05-05-2009 , 16:43   Re: [ZP] Extra Item: Teleport
Reply With Quote #2

i teste here, and everything is working,awesome plugin!
GJ!
TheKidz is offline
Bummps
Senior Member
Join Date: Mar 2009
Location: Brazil
Old 05-05-2009 , 21:53   Re: [ZP] Extra Item: Teleport
Reply With Quote #3

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 ? :/
__________________





Last edited by Bummps; 05-05-2009 at 21:57.
Bummps is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 05-06-2009 , 00:58   Re: [ZP] Extra Item: Teleport
Reply With Quote #4

Quote:
Originally Posted by Bummps View Post
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.
Attached Files
File Type: zip blinkarrival.zip (50.7 KB, 431 views)
NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
Bummps
Senior Member
Join Date: Mar 2009
Location: Brazil
Old 05-06-2009 , 03:50   Re: [ZP] Extra Item: Teleport
Reply With Quote #5

We need a cvar for autobind key
__________________




Bummps is offline
Pach
Senior Member
Join Date: Feb 2009
Location: Russian Federation
Old 05-06-2009 , 04:00   Re: [ZP] Extra Item: Teleport
Reply With Quote #6

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
// ---------------------------------------- 
__________________
Sorry for my bad English.
Pach is offline
Send a message via ICQ to Pach Send a message via Skype™ to Pach
Old 05-06-2009, 04:16
Bummps
This message has been deleted by Bummps. Reason: Double post
Bummps
Senior Member
Join Date: Mar 2009
Location: Brazil
Old 05-06-2009 , 04:17   Re: [ZP] Extra Item: Teleport
Reply With Quote #7

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
__________________





Last edited by Bummps; 05-06-2009 at 04:22.
Bummps is offline
OrbitaL
Junior Member
Join Date: Jan 2009
Old 05-06-2009 , 05:52   Re: [ZP] Extra Item: Teleport
Reply With Quote #8

What about effects like in war3ft mod?
OrbitaL is offline
Pach
Senior Member
Join Date: Feb 2009
Location: Russian Federation
Old 05-06-2009 , 05:56   Re: [ZP] Extra Item: Teleport
Reply With Quote #9

Quote:
Originally Posted by Bummps View Post
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.
__________________
Sorry for my bad English.
Pach is offline
Send a message via ICQ to Pach Send a message via Skype™ to Pach
w5014560
Member
Join Date: Mar 2009
Old 05-06-2009 , 05:58   Re: [ZP] Extra Item: Teleport
Reply With Quote #10

more bug!,i testit .
butzp_teleport_limit Can not restrict buy and use .
and no Cooling time to next ues
w5014560 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:13.


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