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

Gravity API v0.3


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands       
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 02-06-2016 , 04:37   Gravity API v0.3
Reply With Quote #1

Gravity API

Description
This plugin give you 2 natives wich you can manage user gravity(set/get).

Difference bettwen default one
  • + You can give give directly the exact gravity value you want( without calculating floats )
  • + Return the exact gravity you have
  • + Checking user alive for don't throw errors.
  • + An easy way to take/give gravity, example on "Examples" section.
  • + Save the gravity for users.
API
Quick preview of new natives:

Full documentation can be found there, as well in include file:


Example


Credit's
ChangeLog
V0.3:
  • + Added Save Gravity for users ( New Vault ).
  • + Some natives repaired and code optimized.
V0.2:
  • + Added a new native.
  • + Added some stocks
  • + Removed return -1 and put only "return".
  • + Change "iGravity < 0" to "iGravity < 1" ( Thanks to Nubo. )
V0.1:
  • + First release
Attached Files
File Type: inc gravity_api.inc (1.7 KB, 154 views)
File Type: sma Get Plugin or Get Source (GravityAPI.sma - 714 views - 2.3 KB)

Last edited by Craxor; 02-12-2016 at 08:28.
Craxor is offline
Send a message via ICQ to Craxor
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 02-06-2016 , 05:13   Re: Gravity API v0.1
Reply With Quote #2

I'm not sure how such API is usefull. API is for giving control over some functionalities or to help the coder accomplish something that is hard without.

Here is not the case. Unapproved.
__________________
HamletEagle is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 02-06-2016 , 05:31   Re: Gravity API v0.1
Reply With Quote #3

Quote:
Originally Posted by HamletEagle View Post
I'm not sure how such API is usefull. API is for giving control over some functionalities or to help the coder accomplish something that is hard without.

Here is not the case. Unapproved.
Not so important for me if is approved or unnaproved, just a question, if is unnaproved i have permision to continue add support for it?

Edit: give_user_gravity get_user_gravity ( native from default amxx addon ) is broken, mine working well.

Last edited by Craxor; 02-06-2016 at 05:56.
Craxor is offline
Send a message via ICQ to Craxor
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 02-06-2016 , 05:48   Re: Gravity API v0.2
Reply With Quote #4

Yes, you can do whatever you want with your plugin, also it can be reviewed at any time you want.
Also, there is no give_user_gravity native in amxx core, but set_user_gravity, which you are using in your code and it's not broken in any way.
__________________
HamletEagle is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 02-06-2016 , 05:55   Re: Gravity API v0.2
Reply With Quote #5

Quote:
Originally Posted by HamletEagle View Post
Yes, you can do whatever you want with your plugin, also it can be reviewed at any time you want.
Also, there is no give_user_gravity native in amxx core, but set_user_gravity, which you are using in your code and it's not broken in any way.
Lol, sorry! i wanna mean get_user_gravity .

Here: http://www.amxmodx.org/doc/index.htm...er_gravity.htm

Last edited by Craxor; 02-06-2016 at 07:22.
Craxor is offline
Send a message via ICQ to Craxor
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 02-06-2016 , 06:00   Re: Gravity API v0.2
Reply With Quote #6

set_user_gravity is not broken. If you are talking about the float values, everyone should be able to understand how to use it, or simply do value/sv_gravity. API should not be a lazy wrapper around core functions.
__________________

Last edited by HamletEagle; 02-06-2016 at 06:01.
HamletEagle is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 02-06-2016 , 07:18   Re: Gravity API v0.2
Reply With Quote #7

Quote:
Originally Posted by HamletEagle View Post
set_user_gravity is not broken. If you are talking about the float values, everyone should be able to understand how to use it, or simply do value/sv_gravity. API should not be a lazy wrapper around core functions.
I'm talking about get_user_gravity



( #Wrong link above sorry... )

Last edited by Craxor; 02-06-2016 at 07:20.
Craxor is offline
Send a message via ICQ to Craxor
Depresie
Veteran Member
Join Date: Nov 2013
Old 02-06-2016 , 08:09   Re: Gravity API v0.2
Reply With Quote #8

ahm, no offense, but why an API? for such thing?
__________________
Depresie is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 02-06-2016 , 08:45   Re: Gravity API v0.2
Reply With Quote #9

Quote:
Originally Posted by Depresie View Post
ahm, no offense, but why an API? for such thing?
Normal gravity native: set_user_gravity( id, 0.5 ) // 500
My gravity native: set_player_gravity( id, 500 )

My API return corectly the user gravity, instead get_user_gravity is broken. + You have more natives to manage users gravity ( gravity_api.inc ).

But who care? If i need i use this, if not i will not use. That's all.
Craxor is offline
Send a message via ICQ to Craxor
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 02-07-2016 , 12:26   Re: Gravity API v0.2
Reply With Quote #10

How is it broken? You never told or showed us what is broken about it? Tell us and show a code snippet that proves it.
klippy 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 06:18.


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