AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Capture the Hax help... (https://forums.alliedmods.net/showthread.php?t=20532)

ev0d00b 11-10-2005 21:23

Capture the Hax help...
 
this is my first plugin and im a little lost in what to do so far ive got this

Code:
#include <amxmodx> #include <fun> #define PLUGIN "Capture the Hax" #define VERSION "1.0" #define AUTHOR "ev0d00b" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_cvar("amx_cth", "1")         register_logevent("Round_Start", 2, "0=World triggered", "1=Round_Start") } new hacker  hacker = random(1, get_maxplayers());{     is_user_alive(){         if(is_user_alive = 1);{                 return PLUGIN_CONTINUE         }  new hackerName[32];   get_user_name(hacker,hackerName,31)  set_user_maxspeed (hacker,[ Float:speed = - 2.0 ]

and at the moe it wont do anything but im hoping that this will randomly pick someone and make them run faster please help me.

Zenith77 11-10-2005 21:34

here ya go ;)


Code:
 #include <amxmodx> #include <fun> #define PLUGIN "Capture the Hax" #define VERSION "1.0" #define AUTHOR "ev0d00b" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_cvar("amx_cth", "1")         register_logevent("Round_Start", 2, "0=World triggered", "1=Round_Start") } public Round_Start() {  new id    chooseRandomPlayer(id)  if( id == 0 ) return PLUGIN_HANDLED  new hackerName[32];  get_user_name(id,hackerName,31)  set_user_maxspeed (id, -2.0 ) } public chooseRandomPlayer(index) {  index = random_num(1, get_maxplayers())  if(!is_user_alive(index) ) {        index = 0      set_task(0.1, "Restart_Rount" ) // give the funciton time to execute      return index   }  return index // every thing is a-ok }


But there are still other problems, I dont know if this is the complete code or not.

If you run into any problems just post back ;)

v3x 11-10-2005 21:35

Meh.. Try this:
Code:
#include <amxmodx> #include <fun> #define PLUGIN "Capture the Hax" #define VERSION "1.0" #define AUTHOR "ev0d00b" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_cvar("amx_cth", "1")     register_logevent("Round_Start", 2, "0=World triggered", "1=Round_Start")     register_event("CurWeapon", "Check_Speed", "be")     set_cvar_num("sv_maxspeed", 1000) } new hacking[33]; new last_hacker; public client_connect(id)   hacking[id] = 0; public client_disconnect(id)   hacking[id] = 0; public Round_Start() {   if(!get_cvar_num("amx_cth"))     return PLUGIN_CONTINUE;   hacking[last_hacker] = 0;   new hacker = random_num(1, get_maxplayers());   if(is_user_connected(hacker) && is_user_alive(hacker))   {     new hackerName[32];     get_user_name(hacker, hackerName, 31);     hacking[hacker] = 1;     last_hacker = hacker;     client_print(0, print_chat, "%s is haxing! zomg", hackerName);   }   else   {     Round_Start();   }   return PLUGIN_CONTINUE; } public Check_Speed(id) {   if(hacking[id] == 1)     set_user_maxspeed(id, 999.0); }

ev0d00b 11-10-2005 22:27

omg thanks heaps. and thats only a fraction of it though unfortunatly. i still play to make the hacker glow, and that when some kills the hacker steals the hacks and gets it em self.

l0l "zomg"

thank you.

i may need some help with the getting the hacks off another person though glowing i should be fine.

v3x 11-10-2005 22:33

Well, my version automatically takes it off of whoever was last. Although I didn't add checking to see if the player selected already had it last round :P

ev0d00b 11-10-2005 22:37

yea what i think it needs is.

Code:
register_logevent("Game_Commencing", 2, "0=World triggered", "Game_Commencing ")

or something along those lines

v3x 11-10-2005 22:45

Shouldn't need that :P

ev0d00b 11-10-2005 22:46

now im lost and confused :D

mind helping me?

XxAvalanchexX 11-10-2005 22:53

Ahem.

Code:
new players[32], num; get_players(players, num); new randPlayer = players[random_num(0,num-1)];

ev0d00b 11-10-2005 22:59

Quote:

Originally Posted by XxAvalanchexX
Ahem.

Code:
new players[32], num; get_players(players, num); new randPlayer = players[random_num(0,num-1)];

in replace of this?

Code:
 new hacker = random_num(1, get_maxplayers());   if(is_user_connected(hacker) && is_user_alive(hacker))


All times are GMT -4. The time now is 23:57.

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