Raised This Month: $51 Target: $400
 12% 

get sv_footsteps


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pixel3
Senior Member
Join Date: Dec 2005
Old 01-31-2006 , 16:35   get sv_footsteps
Reply With Quote #1

Hi,

since nobody wanted to help me I tho I'll try to make this plugin myself. I just read the manual before and I found that pawn/small is quite easy stuff. Very similar to php and c++. So, now to disable footsteps on player I used set_user_footsteps(id, 1). But is there a way I can find out if footsteps are already enable on this player? I didnt find function like get_user_footsteps or smth. Is there any other way to get this?
__________________
pixel3 is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 01-31-2006 , 16:41  
Reply With Quote #2

get_user_footsteps
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Charr
Senior Member
Join Date: Jul 2005
Location: Long Island, New York, U
Old 01-31-2006 , 16:43  
Reply With Quote #3

I don't think there is a get_user_footsteps, so you could try using a global var for the plugin.
Charr is offline
Send a message via AIM to Charr Send a message via MSN to Charr
pixel3
Senior Member
Join Date: Dec 2005
Old 01-31-2006 , 16:46  
Reply With Quote #4

Quote:
Originally Posted by Charr
I don't think there is a get_user_footsteps, so you could try using a global var for the plugin.
Yeah, ur correct. There is no get_user_footsteps(). Can u explain me a little about this global var?
__________________
pixel3 is offline
Des12
Senior Member
Join Date: Jan 2005
Old 01-31-2006 , 16:50  
Reply With Quote #5

Code:
new footsteps[33] = 1 // ... public footOn(id) {     if(footsteps[id] == 0)           set_user_footsteps(id, 1)     else           client_print(id,print_chat,"[AMXX] You already have footsteps!")     return PLUGIN_HANDLED } public footOff(id) {     if(footsteps[id] == 1)           set_user_footsteps(id, 0)     else           client_print(id,print_chat,"[AMXX] Your footsteps are already disabled!")     return PLUGIN_HANDLED } public client_connect(id) {     set_user_footsteps(id, 1)     footsteps[id] = 1     return PLUGIN_HANDLED } public client_disconnect(id) {     footsteps[id] = 0     return PLUGIN_HANDLED }

Conjured that up real quick, the new footsteps[33] holds 32 variables, which are the id's of players in the servers.

If you need anything else just ask away!
__________________
-Dest Romano

www.JustRP.com
A TSRP Server

Quote:
Originally Posted by Brad
Don't you go be bringing reality into this.
Des12 is offline
Charr
Senior Member
Join Date: Jul 2005
Location: Long Island, New York, U
Old 01-31-2006 , 16:52  
Reply With Quote #6

A global var is a varible that the whole plugin can use.

Code:
#include <amxmodx> new gThis_is_a_global_var[33]; public plugin_init() ...

The array 33 is for holding the different information of each player.
When declaring a new varible, make it outside of all the "public" functions. When you change the the player's footsteps, also change the var:

(the var is "gFootsetps[33]")
Code:
set_user_footsteps(id,1); gFootsteps[id] = 1;

You can also you them in ifs like other vars:
Code:
if(gFootsteps == 1) { ... }
Charr is offline
Send a message via AIM to Charr Send a message via MSN to Charr
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 01-31-2006 , 17:01  
Reply With Quote #7

Code:
if(entity_get_float(id, EV_INT_flTimeStepSound) == 999.0) {   // Has silent footsteps } else {   // Doesn't }
So you could make a function like this:
Code:
stock get_user_footsteps(id) {   if(entity_get_float(id, EV_INT_flTimeStepSound) == 999.0) {     return 1;   }   return 0; }
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Des12
Senior Member
Join Date: Jan 2005
Old 01-31-2006 , 19:06  
Reply With Quote #8

So using a stock function is basically making your own code? In c++ you can do this easy, so would this work?

Code:
//main code new var = 5; addMe(var); client_print(0,print_chat,"[AMXX] Var is now %i",var); // ... stock addMe( new var ) {    var++;    return var; }
__________________
-Dest Romano

www.JustRP.com
A TSRP Server

Quote:
Originally Posted by Brad
Don't you go be bringing reality into this.
Des12 is offline
Charr
Senior Member
Join Date: Jul 2005
Location: Long Island, New York, U
Old 01-31-2006 , 20:01  
Reply With Quote #9

Yes except remove the new in the header.
Charr is offline
Send a message via AIM to Charr Send a message via MSN to Charr
pixel3
Senior Member
Join Date: Dec 2005
Old 02-01-2006 , 04:04  
Reply With Quote #10

Okey, only thing I dont understand right now this entity_get_float. What has this to do with set_user_footsteps?
__________________
pixel3 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 01:59.


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