AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   just a LITTLE BIT MORE PLEASE (https://forums.alliedmods.net/showthread.php?t=57675)

iHaxor.Stan 07-08-2007 22:10

just a LITTLE BIT MORE PLEASE
 
Lol, I know I've been asking for help a lot today, but it's because I'm new to coding and I really want to learn!
Well, now I'm at a point in my plugin where I need to make the following happen for players:
  • Strip All Weapons On New Round (except knife)
I also need to know how to give:
  • Para/Elite to Terrorists On Round Start
  • Only Knife for CT's
Hmm.. Oh yes. I need to know how to make a cvar be able to control whether or not the plugin is on/off. And if the cvar is set to 1, the plugin activates. But if it's set to 0, ofcourse,nothing happens.
And also if it's set to 1, buying ANYTHING AT ALL is restricted for any player in the game.
^^(I know I can search and find how to make the plugin have a cvar to turn on/off, but I needed it more advanced (restrict buying) so if you could just tell me I'd appreciate it greatly!)

And also. I don't want the CT's to be able to pick up the T's guns if they kill a terrorist. So I am very needy for something that makes CT's drop guns as soon as they pick them up. Like the awp restricter plugin :D


Anything you could help with (that i said above) will be so much appreciated!!
This is too much I know, but I assure you, you'll be recieving lots of credit and karma :D :D



EDIT: Aw man I almost forgot! I'm making the T's glow red with
Code:

set_user_rendering(id,kRenderFxGlowShell,255,0,0,kRenderNormal,20)
For the CT's I dont want them to glow. I want them 80% invisible. I know it's possible by doing something with that code above, but I'm not sure how :|
Thx :D

Arkshine 07-08-2007 22:18

Re: just a LITTLE BIT MORE PLEASE
 
iHaxor : Try to search a little before posting.

Go here : http://www.amxmodx.org/funcwiki.php .
And search the function where you need some help. ;)
You'll find function's description.

To strip weapons, see : strip_user_weapons()
To give item, see give_item()

See rendor modes for set_user_rendering().

iHaxor.Stan 07-08-2007 22:27

Re: just a LITTLE BIT MORE PLEASE
 
I know I know, but all that is so confusing trying to read. I learn a LOT quicker by examples, hah :)
I searched on funcwiki for strip_user_weapons, and it doesn't really say how to use it. It just explains what it does. Which I know :|

Arkshine 07-08-2007 22:32

Re: just a LITTLE BIT MORE PLEASE
 
strip_user_weapons( id ) . id = player.

It strips all weapons (knife included I believe. You may have to give knife with give_item() after that.).


give_item( id, item[] ); see weapons name here : http://wiki.alliedmods.net/CS_Weapons_Information

example : give_item( id, "weapons_knife" ); give a knife to player.

iHaxor.Stan 07-08-2007 22:38

Re: just a LITTLE BIT MORE PLEASE
 
so if I wanted to strip terrorist's weapons I'd just do:
Code:

switch(cs_get_user_team(id))
{
case CS_TEAM_T:
    {
    strip_user_weapons()
    }
}

See that's what I'm confused about... Is it right?

Lee 07-08-2007 23:12

Re: just a LITTLE BIT MORE PLEASE
 
Code:
new maxPlayers = get_maxplayers();     for(new i = 1; i <= maxPlayers; i++) {     if(!is_user_connected(i))     {         continue;     }             if(get_user_team(i) == CS_TEAM_T)     {         strip_user_weapons(i);         give_item(i, "weapon_knife");     } }

iHaxor.Stan 07-09-2007 07:38

Re: just a LITTLE BIT MORE PLEASE
 
Jeez man thanks Sooo much you rock.

iHaxor.Stan 07-09-2007 18:05

Re: just a LITTLE BIT MORE PLEASE
 
okay, I HAVE looked up register_logevent on funcwiki, but it still feels like reading a different language or something. :|
I am wanting to call the function for Round Start.
For round end, I am using:
Code:

register_logevent("roundEnd", 2, "1=Round_End");
+
public roundEnd()
{
// MY CODES
}

I need to know how to use register_logevent for round start instead of round end.
Yes I searched!! Sorry if I missed something!

Alka 07-09-2007 18:10

Re: just a LITTLE BIT MORE PLEASE
 
Code:

register_logevent("round_start", 2, "1=Round_Start")
;)

iHaxor.Stan 07-09-2007 18:14

Re: just a LITTLE BIT MORE PLEASE
 
+karma
thanks for going straight into the code, I learn better from examples rather than writing :D


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

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