AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   CSGO Items API (https://forums.alliedmods.net/showthread.php?t=279187)

SM9 02-17-2016 12:47

CSGO Items API
 
If you came here to download CSGOItems you can find the code here: https://bitbucket.org/SM91337/csgo-items/src but be warned, CSGOItems is old, broken and the code is kind of embarrassing.

I promised everyone that I would update this, I'm sorry for promising something that I could not deliver, my mental health won't allow me at this time, maybe one day.

Franc1sco 02-17-2016 15:16

Re: CSGO Items API
 
Seems very useful. I will check more this API. Good job :bacon!::bacon!:

Darkness_ 02-17-2016 16:14

Re: CSGO Items API
 
Very nice. Thanks for sharing.

Potato Uno 02-17-2016 17:47

Re: CSGO Items API
 
Isn't bringing TF2Items to csgo going to result in bans for inventory violations?

SM9 02-17-2016 18:06

Re: CSGO Items API
 
Quote:

Originally Posted by Potato Uno (Post 2393872)
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.

Deathknife 02-17-2016 19:13

Re: CSGO Items API
 
Great work.

zipcore 02-18-2016 06:26

Re: CSGO Items API
 
I just miss ammo natives to set a custom amount. Everything else seems to be great.

SM9 02-18-2016 07:59

Re: CSGO Items API
 
Quote:

Originally Posted by zipcore (Post 2394039)
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 :)

Potato Uno 02-18-2016 08:27

Re: CSGO Items API
 
Quote:

Originally Posted by xCoderx (Post 2393877)
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.

SM9 02-19-2016 14:29

Re: CSGO Items API
 
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.

SM9 02-21-2016 19:49

Re: CSGO Items API
 
Heres the first example plugin guys, https://bitbucket.org/SM91337/csgo-i...e-view-default

This is a dynamic weapon menu which is always up to date with new weapons valve may add to the game, could be very useful for a Deathmatch plugin or something. I am still working on improving and extending internals of the Item Core so Natives and Forwards may get changed, added and removed. Just a heads up one that one :P

asherkin 02-28-2016 17:38

Re: CSGO Items API
 
Quote:

Originally Posted by xCoderx (Post 2393783)
similar to TF2Item

Quote:

Originally Posted by xCoderx (Post 2393783)
lets bring TF2Items to CSGO, Its about time eh?!

This literally doesn't have a single piece of functionality in common with TF2Items (which is good, because a TF2Items-equivalent would trigger the auto-ban detection), you're probably thinking of plugins like "TF2 Item DB" and TF2ItemsInfo.

8guawong 08-03-2016 05:22

Re: CSGO Items API
 
can't compile the code on first post...

//// test3.sp
//
// C:\Users\xxx\Dropbox\sm 1.8\test3.sp(1) : error 010: invalid function or decl
aration
// C:\Users\xxx\Dropbox\sm 1.8\test3.sp(30) : error 017: undefined symbol "CSGOI
tems_GetActiveWeaponDefIndex"
// C:\Users\xxx\Dropbox\sm 1.8\test3.sp(31) : error 017: undefined symbol "CSGOI
tems_GetWeaponClipAmmoByDefIndex"
//
// 3 Errors.
//
// Compilation Time: 0.12 sec
// ----------------------------------------

root88 08-08-2016 06:22

Re: CSGO Items API
 
#include <csgoitems>

Neuro Toxin 08-08-2016 06:50

Re: CSGO Items API
 
Does this still read all the items data after Valve split the keys over multiple sections of games_items.txt?

Mitchell 08-10-2016 19:53

Re: CSGO Items API
 
will this ever support reading weapon's spread values etc?

8guawong 08-10-2016 21:45

Re: CSGO Items API
 
Quote:

Originally Posted by root88 (Post 2443242)
#include <csgoitems>

already included

SM9 08-11-2016 07:12

Re: CSGO Items API
 
Quote:

Originally Posted by Neuro Toxin (Post 2443248)
Does this still read all the items data after Valve split the keys over multiple sections of games_items.txt?

Indeed

Quote:

Originally Posted by Mitchell (Post 2443970)
will this ever support reading weapon's spread values etc?

Sure, I can get round to doing that at some point.

Quote:

Originally Posted by 8guawong (Post 2443995)
already included

Thats odd, you must be doing something wrong since it works fine on my end, can you show me contents of the csgoitems.inc you have?

Also just pushed an update to fix some stuff which valve broke in last csgo update.

8guawong 08-11-2016 10:09

Re: CSGO Items API
 
Quote:

Originally Posted by xCoderx (Post 2444085)
Indeed


Sure, I can get round to doing that at some point.


Thats odd, you must be doing something wrong since it works fine on my end, can you show me contents of the csgoitems.inc you have?

Also just pushed an update to fix some stuff which valve broke in last csgo update.

PHP Code:

#if defined _csgoitems_included_
#endinput
#endif
#define _csgoitems_included_

native int CSGOItems_GetWeaponCount();
native int CSGOItems_GetMusicKitCount();
native int CSGOItems_GetSkinCount();
native int CSGOItems_GetActiveWeaponCount(const char[] chClassNameint iTeam 0);

// WEAPONS
native int CSGOItems_GetWeaponNumByDefIndex(int iDefIndex);
native int CSGOItems_GetWeaponNumByClassName(const char[] chClassName);
native int CSGOItems_GetWeaponDefIndexByWeaponNum(int iWeaponNum);
native bool CSGOItems_GetWeaponDefIndexByClassName(const char[] chClassName);
native bool CSGOItems_GetWeaponClassNameByWeaponNum(int iWeaponNumchar[] chBufferint iLengh);
native bool CSGOItems_GetWeaponClassNameByDefIndex(int iDefIndexchar[] chBufferint iLengh);
native bool CSGOItems_GetWeaponDisplayNameByDefIndex(int iDefIndexchar[] chBufferint iLengh);
native bool CSGOItems_GetWeaponDisplayNameByClassName(const char[] chClassNamechar[] chBufferint iLengh);
native bool CSGOItems_GetWeaponDisplayNameByWeaponNum(int iWeaponNumchar[] chBufferint iLengh);
native bool CSGOItems_IsDefIndexKnife(int iDefIndex);
native int CSGOItems_GetWeaponDefIndexByWeapon(int iWeapon);
native bool CSGOItems_GetWeaponClassNameByWeapon(int iWeaponchar[] chBufferint iLengh);
native int CSGOItems_GetActiveWeapon(int iClient);
native int CSGOItems_GetActiveWeaponDefIndex(int iClient);
native bool CSGOItems_GetActiveClassName(int iClientchar[] chBufferint iLengh);
native bool CSGOItems_IsSkinnableDefIndex(int iDefIndex);
native int CSGOItems_FindWeaponByClassName(int iClient, const char[] chClassName);
native int CSGOItems_GetActiveWeaponNum(int iClient);
native int CSGOItems_GetWeaponSlotByWeaponNum(int iWeaponNum);
native int CSGOItems_GetWeaponSlotByClassName(const char[] chClassName);
native int CSGOItems_GetWeaponSlotByDefIndex(int iDefIndex);
native int CSGOItems_GetWeaponTeamByDefIndex(int iDefIndex);
native int CSGOItems_GetWeaponTeamByClassName(const char[] chClassName);
native int CSGOItems_GetWeaponTeamByWeaponNum(int iWeaponNum);
native int CSGOItems_GetWeaponClipAmmoByDefIndex(int iDefIndex);
native int CSGOItems_GetWeaponClipAmmoByClassName(const char[] chClassName);
native int CSGOItems_GetWeaponClipAmmoByWeaponNum(int iWeaponNum);
native int CSGOItems_GetWeaponReserveAmmoByDefIndex(int iDefIndex);
native int CSGOItems_GetWeaponReserveAmmoByClassName(const char[] chClassName);
native int CSGOItems_GetWeaponReserveAmmoByWeaponNum(int iWeaponNum);
native int CSGOItems_GetWeaponKillAwardByDefIndex(int iDefIndex);
native int CSGOItems_GetWeaponKillAwardByClassName(const char[] chClassName);
native int CSGOItems_GetWeaponKillAwardByWeaponNum(int iWeaponNum);
native bool CSGOItems_GetItemSetNumByClassName(const char[] chClassNamechar[] chBufferint iLengh);
native bool CSGOItems_GetItemSetDisplayNameByClassName(const char[] chClassNamechar[] chBufferint iLengh);
native bool CSGOItems_GetItemSetDisplayNameByItemSetNum(int iSetNumchar[] chBufferint iLengh);
native bool CSGOItems_RefillClipAmmo(int iWeapon);
native bool CSGOItems_RefillReserveAmmo(int iWeapon);
native bool CSGOItems_IsValidWeapon(int iWeapon);
native int CSGOItems_GiveWeapon(int iClient, const char[] chClassNameint iReserveAmmo = -1int iClipAmmo = -1int iSwitchTo = -1);
native bool CSGOItems_RemoveKnife(int iClient);
native bool CSGOItems_RemoveWeapon(int iClientint iWeapon);
native int CSGOItems_RemoveAllWeapons(int iClientint iSkipSlot = -1);
native bool CSGOItems_SetWeaponAmmo(int iWeaponint iReserveAmmo = -1int iClipAmmo = -1);
native int CSGOItems_SetAllWeaponsAmmo(const char[] chClassNameint iReserveAmmo = -1int iClipAmmo = -1);
native bool CSGOItems_SetActiveWeapon(int iClientint iWeapon);
native int CSGOItems_GetActiveWeaponSlot(int iClient);
native bool CSGOItems_AreItemsSynced();
native bool CSGOItems_AreItemsSyncing();
native bool CSGOItems_ReSync();
native int CSGOItems_GetRandomSkin();

// SKINS
native int CSGOItems_GetSkinNumByDefIndex(int iDefIndex);
native int CSGOItems_GetSkinDefIndexBySkinNum(int iSkinNum);
native bool CSGOItems_GetSkinDisplayNameByDefIndex(int iDefIndexchar[] chBufferint iLengh);
native bool CSGOItems_GetSkinDisplayNameBySkinNum(int iSkinNumchar[] chBufferint iLengh);

// MUSIC KITS
native int CSGOItems_GetMusicKitNumByDefIndex(int iDefIndex);
native int CSGOItems_GetMusicKitDefIndexByMusicKitNum(int iMusicKitNum);
native bool CSGOItems_GetMusicKitDisplayNameByDefIndex(int iDefIndexchar[] chBufferint iLengh);
native bool CSGOItems_GetMusicKitDisplayNameByMusicKitNum(int iMusicKitNumchar[] chBufferint iLengh); 

the test code
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.");
    }
    
//AddCommandListener(EventCommandHook, "buyammo1");
    //AddCommandListener(EventCommandHook, "buyammo2");
}

public 
Action:EventCommandHook(client, const String:command[], args
{
    if(
StrEqual(command"buyammo1") || StrEqual(command"buyammo2"))
    {
        
PrintToChat(client"default ammo: %d"GetActiveDefaultClipAmmo(client));
    }
}

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.



SM9 08-11-2016 13:44

Re: CSGO Items API
 
Quote:

Originally Posted by 8guawong (Post 2444109)
PHP Code:

#if defined _csgoitems_included_
#endinput
#endif
#define _csgoitems_included_

native int CSGOItems_GetWeaponCount();
native int CSGOItems_GetMusicKitCount();
native int CSGOItems_GetSkinCount();
native int CSGOItems_GetActiveWeaponCount(const char[] chClassNameint iTeam 0);

// WEAPONS
native int CSGOItems_GetWeaponNumByDefIndex(int iDefIndex);
native int CSGOItems_GetWeaponNumByClassName(const char[] chClassName);
native int CSGOItems_GetWeaponDefIndexByWeaponNum(int iWeaponNum);
native bool CSGOItems_GetWeaponDefIndexByClassName(const char[] chClassName);
native bool CSGOItems_GetWeaponClassNameByWeaponNum(int iWeaponNumchar[] chBufferint iLengh);
native bool CSGOItems_GetWeaponClassNameByDefIndex(int iDefIndexchar[] chBufferint iLengh);
native bool CSGOItems_GetWeaponDisplayNameByDefIndex(int iDefIndexchar[] chBufferint iLengh);
native bool CSGOItems_GetWeaponDisplayNameByClassName(const char[] chClassNamechar[] chBufferint iLengh);
native bool CSGOItems_GetWeaponDisplayNameByWeaponNum(int iWeaponNumchar[] chBufferint iLengh);
native bool CSGOItems_IsDefIndexKnife(int iDefIndex);
native int CSGOItems_GetWeaponDefIndexByWeapon(int iWeapon);
native bool CSGOItems_GetWeaponClassNameByWeapon(int iWeaponchar[] chBufferint iLengh);
native int CSGOItems_GetActiveWeapon(int iClient);
native int CSGOItems_GetActiveWeaponDefIndex(int iClient);
native bool CSGOItems_GetActiveClassName(int iClientchar[] chBufferint iLengh);
native bool CSGOItems_IsSkinnableDefIndex(int iDefIndex);
native int CSGOItems_FindWeaponByClassName(int iClient, const char[] chClassName);
native int CSGOItems_GetActiveWeaponNum(int iClient);
native int CSGOItems_GetWeaponSlotByWeaponNum(int iWeaponNum);
native int CSGOItems_GetWeaponSlotByClassName(const char[] chClassName);
native int CSGOItems_GetWeaponSlotByDefIndex(int iDefIndex);
native int CSGOItems_GetWeaponTeamByDefIndex(int iDefIndex);
native int CSGOItems_GetWeaponTeamByClassName(const char[] chClassName);
native int CSGOItems_GetWeaponTeamByWeaponNum(int iWeaponNum);
native int CSGOItems_GetWeaponClipAmmoByDefIndex(int iDefIndex);
native int CSGOItems_GetWeaponClipAmmoByClassName(const char[] chClassName);
native int CSGOItems_GetWeaponClipAmmoByWeaponNum(int iWeaponNum);
native int CSGOItems_GetWeaponReserveAmmoByDefIndex(int iDefIndex);
native int CSGOItems_GetWeaponReserveAmmoByClassName(const char[] chClassName);
native int CSGOItems_GetWeaponReserveAmmoByWeaponNum(int iWeaponNum);
native int CSGOItems_GetWeaponKillAwardByDefIndex(int iDefIndex);
native int CSGOItems_GetWeaponKillAwardByClassName(const char[] chClassName);
native int CSGOItems_GetWeaponKillAwardByWeaponNum(int iWeaponNum);
native bool CSGOItems_GetItemSetNumByClassName(const char[] chClassNamechar[] chBufferint iLengh);
native bool CSGOItems_GetItemSetDisplayNameByClassName(const char[] chClassNamechar[] chBufferint iLengh);
native bool CSGOItems_GetItemSetDisplayNameByItemSetNum(int iSetNumchar[] chBufferint iLengh);
native bool CSGOItems_RefillClipAmmo(int iWeapon);
native bool CSGOItems_RefillReserveAmmo(int iWeapon);
native bool CSGOItems_IsValidWeapon(int iWeapon);
native int CSGOItems_GiveWeapon(int iClient, const char[] chClassNameint iReserveAmmo = -1int iClipAmmo = -1int iSwitchTo = -1);
native bool CSGOItems_RemoveKnife(int iClient);
native bool CSGOItems_RemoveWeapon(int iClientint iWeapon);
native int CSGOItems_RemoveAllWeapons(int iClientint iSkipSlot = -1);
native bool CSGOItems_SetWeaponAmmo(int iWeaponint iReserveAmmo = -1int iClipAmmo = -1);
native int CSGOItems_SetAllWeaponsAmmo(const char[] chClassNameint iReserveAmmo = -1int iClipAmmo = -1);
native bool CSGOItems_SetActiveWeapon(int iClientint iWeapon);
native int CSGOItems_GetActiveWeaponSlot(int iClient);
native bool CSGOItems_AreItemsSynced();
native bool CSGOItems_AreItemsSyncing();
native bool CSGOItems_ReSync();
native int CSGOItems_GetRandomSkin();

// SKINS
native int CSGOItems_GetSkinNumByDefIndex(int iDefIndex);
native int CSGOItems_GetSkinDefIndexBySkinNum(int iSkinNum);
native bool CSGOItems_GetSkinDisplayNameByDefIndex(int iDefIndexchar[] chBufferint iLengh);
native bool CSGOItems_GetSkinDisplayNameBySkinNum(int iSkinNumchar[] chBufferint iLengh);

// MUSIC KITS
native int CSGOItems_GetMusicKitNumByDefIndex(int iDefIndex);
native int CSGOItems_GetMusicKitDefIndexByMusicKitNum(int iMusicKitNum);
native bool CSGOItems_GetMusicKitDisplayNameByDefIndex(int iDefIndexchar[] chBufferint iLengh);
native bool CSGOItems_GetMusicKitDisplayNameByMusicKitNum(int iMusicKitNumchar[] chBufferint iLengh); 

the test code
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.");
    }
    
//AddCommandListener(EventCommandHook, "buyammo1");
    //AddCommandListener(EventCommandHook, "buyammo2");
}

public 
Action:EventCommandHook(client, const String:command[], args
{
    if(
StrEqual(command"buyammo1") || StrEqual(command"buyammo2"))
    {
        
PrintToChat(client"default ammo: %d"GetActiveDefaultClipAmmo(client));
    }
}

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.



Compiles fine on my end, are you sure you have the include file in the right directory?

SM9 08-11-2016 21:33

Re: CSGO Items API
 
Quote:

Originally Posted by Mitchell (Post 2443970)
will this ever support reading weapon's spread values etc?

Done.

PHP Code:

native float CSGOItems_GetWeaponSpreadByDefIndex(int iDefIndex);
native float CSGOItems_GetWeaponSpreadByClassName(const char[] chClassName);
native float CSGOItems_GetWeaponSpreadByWeaponNum(int iWeaponNum); 

If there is anything else people would like then please let me know.

8guawong 08-11-2016 21:43

Re: CSGO Items API
 
Quote:

Originally Posted by xCoderx (Post 2444152)
Compiles fine on my end, are you sure you have the include file in the right directory?

yes....

SM9 08-11-2016 21:49

Re: CSGO Items API
 
Quote:

Originally Posted by 8guawong (Post 2444261)
yes....

I honestly can't help you then in that case :shock:

Mitchell 08-11-2016 21:51

Re: CSGO Items API
 
Quote:

Originally Posted by xCoderx (Post 2444260)
Done.

PHP Code:

native float CSGOItems_GetWeaponSpreadByDefIndex(int iDefIndex);
native float CSGOItems_GetWeaponSpreadByClassName(const char[] chClassName);
native float CSGOItems_GetWeaponSpreadByWeaponNum(int iWeaponNum); 

If there is anything else people would like then please let me know.

cycle time (also known as the time it takes to shoot again (firerate))

also if there is a way to get how long a weapon takes to reload that would be awesome.

SM9 08-11-2016 22:33

Re: CSGO Items API
 
Quote:

Originally Posted by Mitchell (Post 2444263)
cycle time (also known as the time it takes to shoot again (firerate

PHP Code:

native float CSGOItems_GetWeaponCycleTimeByDefIndex(int iDefIndex);
native float CSGOItems_GetWeaponCycleTimeByClassName(const char[] chClassName);
native float CSGOItems_GetWeaponCycleTimeByWeaponNum(int iWeaponNum); 

Quote:

Originally Posted by Mitchell (Post 2444263)
also if there is a way to get how long a weapon takes to reload that would be awesome.

Hmm, I can't find anything for this atm, Maybe its a netprop?

Mitchell 08-12-2016 10:25

Re: CSGO Items API
 
Quote:

Originally Posted by xCoderx (Post 2444272)
PHP Code:

native float CSGOItems_GetWeaponCycleTimeByDefIndex(int iDefIndex);
native float CSGOItems_GetWeaponCycleTimeByClassName(const char[] chClassName);
native float CSGOItems_GetWeaponCycleTimeByWeaponNum(int iWeaponNum); 

Hmm, I can't find anything for this atm, Maybe its a netprop?

I think it is determined by the weapon's animation, however i'm not entirely sure.

Neuro Toxin 08-12-2016 19:48

Re: CSGO Items API
 
It's in the weapon scripts as "CycleTime"

There are also spreads:

PHP Code:

    // accuracy model parameters
    
"Spread"                0.60
    
"InaccuracyCrouch"            7.39
    
"InaccuracyStand"            9.85
    
"InaccuracyJump"            0.685
    
"InaccuracyLand"            0.205
    
"InaccuracyLadder"            118.716
    
"InaccuracyFire"            6.70
    
"InaccuracyMove"            99.34 


Mitchell 08-13-2016 02:24

Re: CSGO Items API
 
Quote:

Originally Posted by Neuro Toxin (Post 2444490)
It's in the weapon scripts as "CycleTime"

There are also spreads:

PHP Code:

    // accuracy model parameters
    
"Spread"                0.60
    
"InaccuracyCrouch"            7.39
    
"InaccuracyStand"            9.85
    
"InaccuracyJump"            0.685
    
"InaccuracyLand"            0.205
    
"InaccuracyLadder"            118.716
    
"InaccuracyFire"            6.70
    
"InaccuracyMove"            99.34 


Cycle time isn't the reload time. He already added cycle time and the spread to the code.

paulo_crash 01-16-2018 06:27

Re: CSGO Items API
 
I have the following errors on the console:
Quote:

L 01/16/2018 - 01:55:48: [SM] Exception reported: Array index is out of bounds
L 01/16/2018 - 01:55:48: [SM] Blaming: CSGO_Items.smx
L 01/16/2018 - 01:55:48: [SM] Call stack trace:
L 01/16/2018 - 01:55:48: [SM] [1] Line 1210, C:\Users\Michael\OneDrive\Documents\Developme nt\PAWN\Projects\CSGO-Items\addons\sourcemod\scripting\CSGO_Items.s p::SyncItemData
L 01/16/2018 - 01:55:48: [SM] [2] Line 1016, C:\Users\Michael\OneDrive\Documents\Developme nt\PAWN\Projects\CSGO-Items\addons\sourcemod\scripting\CSGO_Items.s p::Timer_SyncSchema
L 01/16/2018 - 01:55:50: [SM] Exception reported: Array index is out of bounds
L 01/16/2018 - 01:55:50: [SM] Blaming: CSGO_Items.smx
L 01/16/2018 - 01:55:50: [SM] Call stack trace:
L 01/16/2018 - 01:55:50: [SM] [1] Line 1210, C:\Users\Michael\OneDrive\Documents\Developme nt\PAWN\Projects\CSGO-Items\addons\sourcemod\scripting\CSGO_Items.s p::SyncItemData
L 01/16/2018 - 01:55:50: [SM] [2] Line 1016, C:\Users\Michael\OneDrive\Documents\Developme nt\PAWN\Projects\CSGO-Items\addons\sourcemod\scripting\CSGO_Items.s p::Timer_SyncSchema
L 01/16/2018 - 01:55:51: [SM] Exception reported: Array index is out of bounds
I got the latest version here: https://bitbucket.org/SM91337/csgo-items/src

SM9 01-24-2018 15:44

Re: CSGO Items API
 
Quote:

Originally Posted by paulo_crash (Post 2572280)
I have the following errors on the console:

I got the latest version here: https://bitbucket.org/SM91337/csgo-items/src

Should be fixed now, please download the latest version again thanks.

paulo_crash 01-25-2018 06:47

Re: CSGO Items API
 
Quote:

Originally Posted by xCoderx (Post 2573926)
Should be fixed now, please download the latest version again thanks.

I upgraded and everything, but it continues with the same problem:
Quote:

L 01/25/2018 - 01:44:23: [CSGO_Items.smx] Item Schema successfully processed, syncing item data.

L 01/25/2018 - 01:44:34: [SM] Exception reported: Script execution timed out

L 01/25/2018 - 01:44:34: [SM] Blaming: CSGO_Items.smx

L 01/25/2018 - 01:44:34: [SM] Call stack trace:

L 01/25/2018 - 01:44:34: [SM] [1] Line 1370, C:\Users\Michael\OneDrive\Documents\Developme nt\PAWN\Projects\CSGO-Items\addons\sourcemod\scripting\CSGO_Items.s p::SyncItemData

L 01/25/2018 - 01:44:34: [SM] [2] Line 1019, C:\Users\Michael\OneDrive\Documents\Developme nt\PAWN\Projects\CSGO-Items\addons\sourcemod\scripting\CSGO_Items.s p::Timer_SyncSchema

SM9 01-26-2018 10:54

Re: CSGO Items API
 
Quote:

Originally Posted by paulo_crash (Post 2574026)
I upgraded and everything, but it continues with the same problem:

Unfortunately, The initial iteration has a lot of nested loops in order to properly link everything together, It needs some heavy optimization which I am going to be working on in the near future, The only way to work around this for now is by modifying your core.cfg and setting the slow script timeout to 0, I know its bad advice on my part and you should not be expected to do such thing, but after the initial loop (which I must warn you will hang your server for approximately 20-30 seconds after a restart) the rest of the code should be super fast and efficient.

This is a very important issue which is on my todo list to fix, For now though please consider my advice with the core.cfg option as a workaround.


Grab version 1.4.7, I have heavily optimized the speed, Should be around 5 seconds now.

Thanks.

paulo_crash 01-27-2018 07:13

Re: CSGO Items API
 
The problem continues with the same flood on the console:
Quote:

L 01/27/2018 - 02:11:49: [SM] Exception reported: Script execution timed out

L 01/27/2018 - 02:11:49: [SM] Blaming: CSGO_Items.smx

L 01/27/2018 - 02:11:49: [SM] Call stack trace:

L 01/27/2018 - 02:11:49: [SM] [1] Line 505, C:\Users\Michael\OneDrive\Documents\Developme nt\PAWN\Plugins\Active\include\string.inc::Ex plodeString

L 01/27/2018 - 02:11:49: [SM] [2] Line 1410, C:\Users\Michael\OneDrive\Documents\Developme nt\PAWN\Projects\CSGO-Items\addons\sourcemod\scripting\CSGO_Items.s p::SyncItemData

L 01/27/2018 - 02:11:49: [SM] [3] Line 1024, C:\Users\Michael\OneDrive\Documents\Developme nt\PAWN\Projects\CSGO-Items\addons\sourcemod\scripting\CSGO_Items.s p::Timer_SyncSchema

L 01/27/2018 - 02:11:50: [CSGO_Items.smx] Item Schema successfully processed, syncing item data.
I also noticed that the servers are restarting due to this BUG, ​​because when I shoot the plugin simply stops rebooting.

And only this error flood is left on the console and it is marked as offline in the community list.

Anyway thanks for trying to fix, I'll be waiting for more updates on your part.

Neuro Toxin 01-28-2018 15:18

Re: CSGO Items API
 
I get around script timeouts by making use of RequestFrame between major functions.

A base plugin that does this also disables hibernation before starting if required them setting it back.

paulo_crash 02-14-2018 19:53

Re: CSGO Items API
 
Quote:

Originally Posted by xCoderx (Post 2574276)
Unfortunately, The initial iteration has a lot of nested loops in order to properly link everything together, It needs some heavy optimization which I am going to be working on in the near future, The only way to work around this for now is by modifying your core.cfg and setting the slow script timeout to 0, I know its bad advice on my part and you should not be expected to do such thing, but after the initial loop (which I must warn you will hang your server for approximately 20-30 seconds after a restart) the rest of the code should be super fast and efficient.

This is a very important issue which is on my todo list to fix, For now though please consider my advice with the core.cfg option as a workaround.


Grab version 1.4.7, I have heavily optimized the speed, Should be around 5 seconds now.

Thanks.

I saw that you are updating the plugin still at the link: https://bitbucket.org/SM91337/csgo-items/commits/all

Would it be the correction of BUGS? Hope so :)

ESK0 02-15-2018 02:04

Re: CSGO Items API
 
Quote:

Originally Posted by paulo_crash (Post 2578241)
I saw that you are updating the plugin still at the link: https://bitbucket.org/SM91337/csgo-items/commits/all

Would it be the correction of BUGS? Hope so :)

Set SlowScriptTimeout to 0 in core.cfg to fix your error you posed above

paulo_crash 02-15-2018 09:21

Re: CSGO Items API
 
Quote:

Originally Posted by ESK0 (Post 2578272)
Set SlowScriptTimeout to 0 in core.cfg to fix your error you posed above

I'll be doing the test, thank you.

One question only about this command, does it harm the plugins or the server in any way? Does the plugins work?

ESK0 02-15-2018 10:17

Re: CSGO Items API
 
Quote:

Originally Posted by paulo_crash (Post 2578311)
I'll be doing the test, thank you.

One question only about this command, does it harm the plugins or the server in any way? Does the plugins work?

Its working great.. The only reason for this is that parsing all the data takes more time than is SlowScriptTimeout.. It can be fixed with using RequestFrame as mentioned above or with this.. If you are not familiar with sourcemod coding.. You should set SlowScriptTimeout to 0

plock 06-15-2018 13:22

Re: CSGO Items API
 
If I download the files and host it on a localhost, will it work? Or it requires some php functions/api to load properly via plugin?

Neuro Toxin 06-15-2018 20:35

Re: CSGO Items API
 
This reads the items script. No http APIs are used.


All times are GMT -4. The time now is 22:31.

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