Raised This Month: $ Target: $400
 0% 

scripting help..


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SAMURAI16
BANNED
Join Date: Sep 2006
Old 01-07-2007 , 04:51   scripting help..
Reply With Quote #1

so i want to make an plugin but i need some help
I need an example to check if player is in walking, in jump and have an HE grenade in hand. And after i will add stuff .
Thanks
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
Salepate
Junior Member
Join Date: Jan 2007
Old 01-07-2007 , 05:16   Re: scripting help..
Reply With Quote #2

If you mean :
player is walking Or jumping but in any case with a HE in hand. I guess it would be :
Code:
if ( (pev(id,pev_button) & IN_JUMP) || (pev(id,pev_button) & IN_FORWARD) ) {     new temp1,temp2;     if ( get_user_weapon(id,temp1,temp2) == 4 ) {         // Your Code     } }
Identity of the He Grenade is 4.
So it check if wearer is wearing a weapon with 4 as an id.
(in my case i'm only checking if the user is jumping or walking forward)

Last edited by Salepate; 01-07-2007 at 05:19.
Salepate is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 01-07-2007 , 15:24   Re: scripting help..
Reply With Quote #3

Quote:
Originally Posted by Salepate View Post
If you mean :
player is walking Or jumping but in any case with a HE in hand. I guess it would be :
Code:
if ( (pev(id,pev_button) & IN_JUMP) || (pev(id,pev_button) & IN_FORWARD) ) { new temp1,temp2; if ( get_user_weapon(id,temp1,temp2) == 4 ) { // Your Code } }

Identity of the He Grenade is 4.
So it check if wearer is wearing a weapon with 4 as an id.
(in my case i'm only checking if the user is jumping or walking forward)
Make sure he knows its in client prethink next time..
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
SAMURAI16
BANNED
Join Date: Sep 2006
Old 01-07-2007 , 05:19   Re: scripting help..
Reply With Quote #4

he grenade == 4 ok
But flashbang and smoke wich number have ? And how i can check if all action (jumping,walking, have gren in hand) durring 5 seconds for example
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
Salepate
Junior Member
Join Date: Jan 2007
Old 01-07-2007 , 05:22   Re: scripting help..
Reply With Quote #5

Flashbang : 25
Smoke Grenade : 9
(amxconst.inc)
If you wanna check it on a duration the better way to do is to use PreThink and PostThink (and honnestly I've never used it atm). But with one of these two functions you can check every frame of the player, and in this case, you just have to set a variable to 1 When the user starts.
Set it to 0 if : 5 seconds are reached or the player stopped his movement.
Salepate is offline
Salepate
Junior Member
Join Date: Jan 2007
Old 01-07-2007 , 17:28   Re: scripting help..
Reply With Quote #6

As I said, i've never used neither Prethink nor Posthink, and I don't know it works, So I could have say something wrong.

My mistake
Salepate 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 22:19.


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