Raised This Month: $ Target: $400
 0% 

a few questions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iHaxor.Stan
BANNED
Join Date: Jul 2007
Old 07-07-2007 , 22:12   a few questions
Reply With Quote #1

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 is offline
iHaxor.Stan
BANNED
Join Date: Jul 2007
Old 07-07-2007 , 23:01   Re: a few questions
Reply With Quote #2

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 ;)
iHaxor.Stan is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 07-08-2007 , 00:58   Re: a few questions
Reply With Quote #3

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>
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 07-08-2007 , 01:30   Re: a few questions
Reply With Quote #4

Quote:
Originally Posted by iHaxor.Stan View Post
-Make him 3 times faster.
set_user_maxspeed(id, get_user_maxspeed(id) * 3);

Quote:
Originally Posted by iHaxor.Stan View Post
-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
hlstriker is offline
iHaxor.Stan
BANNED
Join Date: Jul 2007
Old 07-08-2007 , 08:46   Re: a few questions
Reply With Quote #5

you guys Rock!
iHaxor.Stan is offline
iHaxor.Stan
BANNED
Join Date: Jul 2007
Old 07-08-2007 , 22:00   Re: a few questions
Reply With Quote #6

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
iHaxor.Stan is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 07-08-2007 , 23:03   Re: a few questions
Reply With Quote #7

Yes.
hlstriker is offline
iHaxor.Stan
BANNED
Join Date: Jul 2007
Old 07-09-2007 , 07:39   Re: a few questions
Reply With Quote #8

aight thanks
iHaxor.Stan is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 07-09-2007 , 22:17   Re: a few questions
Reply With Quote #9

please note:

everyone time someone changes their weapon the maxspeed with be reset, you must hook the CurWeapon event and reset their maxspeed.
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
iHaxor.Stan
BANNED
Join Date: Jul 2007
Old 07-09-2007 , 22:56   Re: a few questions
Reply With Quote #10

hm.. thanks ;)
iHaxor.Stan is offline
Reply



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 21:27.


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