AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   a few questions (https://forums.alliedmods.net/showthread.php?t=57600)

iHaxor.Stan 07-07-2007 22:12

a few questions
 
I'm writing a code so that a user can make himself a "Haxor", where that costs 16,000 bucks!
Here's the code so far:
Code:

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#define PLUGIN "Test Mod"
#define VERSION "1.0"
#define AUTHOR "iHaxor.Stan"
 
new haxorprice
new haxorhp
new haxorarmor
 
public plugin_init()
{
 register_plugin(PLUGIN, VERSION, AUTHOR)
 register_clcmd("say /haxor","cmd_haxor");
 
 haxorprice = register_cvar("gm_price","16000")
 haxorhp = register_cvar("gm_health","500")
 haxorarmor = register_cvar("gm_armor","300")
}
 
public cmd_haxor(id)
{
 if(cs_get_user_money(id) < get_pcvar_num(haxorprice))
 {
  client_print(id,print_chat,"Oops! You don't have enough cash to become a Haxor!")
  client_print(id,print_console,"Oops! You don't have enough cash to become a Haxor!")
  return PLUGIN_CONTINUE
 }
 
 else
 {
  set_user_health(id,get_pcvar_num(haxorhp))
  set_user_armor(id,get_pcvar_num(haxorarmor))
  client_print(id,print_chat,"Gratz! Your now a Haxor!")
  client_print(id,print_console,"Gratz! Your now a Haxor!")
 }
 
return PLUGIN_CONTINUE
}

Firstly, I've never made a code before (this is my first post on the forums), so I need to know if that it setup correctly. I was searching old topics and gathered the info I needed to make that.
But now I need to know how to do the following things when the user is a "haxor"

-Make him 3 times faster.
-Make his gravity at 200.
-Make him immune to headshots.
-Make him only have a knife. If he picks up another gun, he automatically drops it. And he cant buy weapons.
-Make him glow red or blue, depending on the team he's on (ct or t).

So can somebody please help me with that stuff? Whatever you can help with would be fantastic!

iHaxor.Stan 07-07-2007 23:01

Re: a few questions
 
Okay, for the glow part, I figured out:
To glow red:
set_user_rendering
(index,kRenderFxGlowShell,255,0,0,kRenderNorm al,25)


To glow blue: set_user_rendering(index,kRenderFxGlowShell,0,0,255,kRenderNorm al,25)

But how to make it so T's glow red, CT's glow blue? :|

And I still need help with everything else ;)

Sorry for the bump, just needed to post this ;)

Drak 07-08-2007 00:58

Re: a few questions
 
Code:
public glow_players() {     static players[32], num     get_players(players,num)     for(new i=0;i<num;i++) {         new id = players[i]                 switch(cs_get_user_team(id))         {             case CS_TEAM_CT: set_user_rendering(id,kRenderFxGlowShell,0,0,255,kRenderNormal,20)             case CS_TEAM_T: set_user_rendering(id,kRenderFxGlowShell,255,0,0,kRenderNormal,20)         }     } }
If you call this function, it should do what you want.

You need to include the Cstrike module, and the fun module.
Code:
#include <cstrike> #include <fun>

hlstriker 07-08-2007 01:30

Re: a few questions
 
Quote:

Originally Posted by iHaxor.Stan (Post 500285)
-Make him 3 times faster.

set_user_maxspeed(id, get_user_maxspeed(id) * 3);

Quote:

Originally Posted by iHaxor.Stan (Post 500285)
-Make his gravity at 200.

set_user_gravity(id, 0.25);


Note that these functions require the fun module (which you already seem to have being loaded).
set_user_maxspeed
get_user_maxspeed
set_user_gravity

iHaxor.Stan 07-08-2007 08:46

Re: a few questions
 
you guys Rock!

iHaxor.Stan 07-08-2007 22:00

Re: a few questions
 
Quote:

set_user_maxspeed(id, get_user_maxspeed(id) * 3);
would it be:
set_user_maxspeed(id, get_user_maxspeed(id) / 2);
if i wanted the speed to be half of normal? please help. thx in advance

hlstriker 07-08-2007 23:03

Re: a few questions
 
Yes.

iHaxor.Stan 07-09-2007 07:39

Re: a few questions
 
aight thanks

Rolnaaba 07-09-2007 22:17

Re: a few questions
 
please note:

everyone time someone changes their weapon the maxspeed with be reset, you must hook the CurWeapon event and reset their maxspeed.

iHaxor.Stan 07-09-2007 22:56

Re: a few questions
 
hm.. thanks ;)


All times are GMT -4. The time now is 21:27.

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