Gravity Help
im making a plugins but i need help.... i need to know how to make it set every1's gravity.. i know i can just change the server cvar but i want it in the plugin. Thx in advanced
|
well, you could use set_user_gravity from the fun module:
Code:
however, it doesn't take an exact number like sv_gravity. instead, it takes a percentage of what the gravity currently is. so, setting amount as 1.0 will give you 100% of current gravity, 0.5 will be 50% of current gravity, and 2.0 will be 200% of current gravity. it is still possible to set it to an exact number (ie: 800 instead of 1.0), by dividing what you want it to be by sv_gravity. since you want to set everyone's gravity, you'll have to get a list of players and loop through it. so, here it is. Code:
just put this somewhere in your code, and then you can call it like any other function to set the gravity of all players in the server. |
a plugin could change the cvar too, then you wouldn't have to do all that. not that its that much, but yeah...
|
Quote:
Code:
|
Re: Gravity Help
ok im prolly a moron but for some reason i cant set up my server.cfg to make it auto 250 for the gravity its for a scout 24/7 server so i dont want it to change i want it to always have 250 gravity
|
Re: Gravity Help
your not supposed to use server_cmd for cvars . Use
Code:
It says right in the doc's , that you shouldnt use server_cmd for cvars. |
Re: Gravity Help
violentcrimes: http://forums.alliedmods.net/showthread.php?t=6516
|
| All times are GMT -4. The time now is 20:19. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.