Raised This Month: $71 Target: $400
 17% 

CSGO Items API


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SM9
AlliedModders Donor
Join Date: Sep 2013
Location: United Kingdom
Old 02-17-2016 , 13:47   CSGO Items API
Reply With Quote #1

Hello guys, I have been working for a while on a private CSGO Items API similar to TF2Items, but today I decided to release it to help other developers work on / update existing plugins to be completely dynamic, A good example of usage could be Building a weapon menu or getting the clip ammo of a weapon which keeps itself updated throughout csgo updates. The API has a lot of features currently but no documentation yet, so I suggest taking a look at the code / include file.

Here is a quick example I wrote for a guy in the scripting forums who wanted to get the default weapon clip of an active weapon, traditionally this was not possible and required hardcoding the weapon clip sizes and updating them when valve changed a weapon, Now its simple and if valve changes the weapon then you don't have to do anything!

I have a lot more ideas to come, but I am also looking for developers who would like to collaborate on this project, lets bring TF2Items to CSGO, Its about time eh?!

PHP Code:
#include <csgoitems>

public Plugin myinfo 
{
    
name "Test Plugin"
    
author "SM9"
    
version "0.1"
    
url "http://www.fragdeluxe.com"
};

public 
void OnPluginStart()
{
    if (
GetEngineVersion() != Engine_CSGO) {
        
SetFailState("This plugin is for CSGO only.");
    }
}

stock int GetActiveDefaultClipAmmo(int iClient
{
    
int iDefIndex CSGOItems_GetActiveWeaponDefIndex(iClient);
    return 
CSGOItems_GetWeaponClipAmmoByDefIndex(iDefIndex);
}

stock bool RefillActiveWeapon(int iClient
{
    
int iWeapon CSGOItems_GetActiveWeaponIndex(iClient);
    return 
CSGOItems_RefillClipAmmo(iWeapon); // true on success.

Thanks for reading, I hope this API will be useful.

You can find the code here: https://bitbucket.org/SM91337/csgo-items/src
__________________
If you like my work and want to help support me, Please consider a Donation

Last edited by SM9; 02-17-2016 at 17:25.
SM9 is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 02-17-2016 , 16:16   Re: CSGO Items API
Reply With Quote #2

Seems very useful. I will check more this API. Good job
__________________
Veteran SourceMod Coder
Taking paid requests -> Add me in TELEGRAM or STEAM
You like my work? donate me


Last edited by Franc1sco; 02-17-2016 at 16:17.
Franc1sco is offline
Send a message via MSN to Franc1sco Send a message via Skype™ to Franc1sco
Darkness_
Veteran Member
Join Date: Nov 2014
Old 02-17-2016 , 17:14   Re: CSGO Items API
Reply With Quote #3

Very nice. Thanks for sharing.
Darkness_ is offline
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 02-17-2016 , 18:47   Re: CSGO Items API
Reply With Quote #4

Isn't bringing TF2Items to csgo going to result in bans for inventory violations?
Potato Uno is offline
SM9
AlliedModders Donor
Join Date: Sep 2013
Location: United Kingdom
Old 02-17-2016 , 19:06   Re: CSGO Items API
Reply With Quote #5

Quote:
Originally Posted by Potato Uno View Post
Isn't bringing TF2Items to csgo going to result in bans for inventory violations?
This API on its own is completely within valves TOS, but there is no guarantee that developers will not abuse it to create plugins which cause violation and I have no control over that. The reason I have released it is because there is so many legitimate things which can be done with this, Honestly I have nothing against violating valves TOS because I feel its very childish and is not good for community servers, but just don't post plugins that do that here because they will be removed / trashed.

I hope this clears things up.
__________________
If you like my work and want to help support me, Please consider a Donation

Last edited by SM9; 02-17-2016 at 19:08.
SM9 is offline
Deathknife
Senior Member
Join Date: Aug 2014
Old 02-17-2016 , 20:13   Re: CSGO Items API
Reply With Quote #6

Great work.
Deathknife is offline
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
Old 02-18-2016 , 07:26   Re: CSGO Items API
Reply With Quote #7

I just miss ammo natives to set a custom amount. Everything else seems to be great.
__________________
zipcore is offline
SM9
AlliedModders Donor
Join Date: Sep 2013
Location: United Kingdom
Old 02-18-2016 , 08:59   Re: CSGO Items API
Reply With Quote #8

Quote:
Originally Posted by zipcore View Post
I just miss ammo natives to set a custom amount. Everything else seems to be great.
How would you like this to work, A little confused as to what you required although I am more than happy to implement it if you can explain it a bit more
__________________
If you like my work and want to help support me, Please consider a Donation
SM9 is offline
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 02-18-2016 , 09:27   Re: CSGO Items API
Reply With Quote #9

Quote:
Originally Posted by xCoderx View Post
This API on its own is completely within valves TOS, but there is no guarantee that developers will not abuse it to create plugins which cause violation and I have no control over that. The reason I have released it is because there is so many legitimate things which can be done with this, Honestly I have nothing against violating valves TOS because I feel its very childish and is not good for community servers, but just don't post plugins that do that here because they will be removed / trashed.

I hope this clears things up.
Yeah that's perfectly fine; people who use this should just be aware that if they misuse it they can be banned at their own fault.
Potato Uno is offline
SM9
AlliedModders Donor
Join Date: Sep 2013
Location: United Kingdom
Old 02-19-2016 , 15:29   Re: CSGO Items API
Reply With Quote #10

Just a quick warning, I am currently adding a lot more functionality and improving existing natives, this means they are subject to change, The reason being is this plugin is still very new, thanks for understanding.
__________________
If you like my work and want to help support me, Please consider a Donation
SM9 is offline
Reply


Thread Tools
Display Modes

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 15:27.


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