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

[Stocks] SStocks


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shaman
Senior Member
Join Date: Dec 2006
Location: Istanbul, Turkey
Old 08-16-2007 , 11:17   [Stocks] SStocks
Reply With Quote #1

SStocks

Includes:
PHP Code:
[sstocks.incUsing this will include other files like 'sourcemod.inc'.
#define COLOR_YELLOW 0x01
#define COLOR_NAME_TEAMCOLOR 0x02
#define COLOR_TEAMCOLOR 0x03
#define COLOR_GREEN 0x04
public EmptyHandler(Handle:menuMenuAction:actionparam1param2){}
#include <ss_basic>
#include <ss_checks>
#include <ss_clients>

[ss_basic.inc]
RestartGame(time=1)
Fail(const String:pname[], const String:format[], any:...)
Debug(const String:pname[], const String:fname[], const String:format[], any:...)
MessageToAll(const String:pname[], const String:format[], any:...)
MessageToOne(client, const String:pname[], const String:format[], any:...)

[
ss_checks.inc]
bool:CheckMod(const String:mod[])
bool:CheckPlugin(const String:pname[])
bool:CheckFile(const String:file_path[])
bool:CheckRequiredFile(const String:file_path[], const String:pname[])
bool:CheckDirectory(const String:directory_path[])
bool:CheckRequiredDirectory(const String:directory_path[], const String:pname[])

[
ss_clients.inc]
ClientData(client, const String:property[], const String:todo[], value=0)
ClientHealth(client, const String:todo[], value=0)
ClientMoney(client, const String:todo[], value=0)
SetClientSpeed(clientFloat:speed)
bool:HasClientFlag(clientAdminFlag:flagAdmAccessMode:mode=Access_Effective)
bool:HasClientFlagExt(clientAdminFlag:flagAdmAccessMode:mode=Access_Effective, const String:pname[], const String:format[], any:...)
CountClientsInTeam(teamindex)
CountAdmins(teamindex


Notes:
  • CheckPlugin uses "*_version" and "sm_*_version" ConVars to check if the plugin is loaded. I am trying to find better way to do this.
  • I tested all functions, but I am still not responsible if your computer blows up.

Thanks To:
  1. BAILOPAN -> CountAdmins()
Attached Files
File Type: rar DevKit 0.0.2.rar (273.6 KB, 828 views)
__________________

Last edited by Shaman; 08-25-2007 at 15:23.
Shaman is offline
Send a message via ICQ to Shaman Send a message via AIM to Shaman Send a message via MSN to Shaman Send a message via Yahoo to Shaman
Peoples Army
SourceMod Donor
Join Date: Mar 2007
Old 08-17-2007 , 10:13   Re: [STOCKS] SStocks
Reply With Quote #2

these will defiantly come in handy , good to have something without extensions for once .
Peoples Army is offline
Shaman
Senior Member
Join Date: Dec 2006
Location: Istanbul, Turkey
Old 08-17-2007 , 11:21   Re: [STOCKS] SStocks
Reply With Quote #3

I use these a lot and tought will help you too. CheckRequiredFile is very useful stock for checking a plugin's translation, config and gamedata files. It sets a fail state automaticly and you don't have to build paths.

You can set, get, increase and decrease a player's data using ClientData and you don't have to mess with "g_iAccount= FindSendPropOffs("CCSPlayer", "m_iAccount");" things anymore.

There are shortcuts for some properties too. For example if you want to give 100$ to a player, this will automaticly get the player's money , add it the value you specify and set it:
Code:
ClientMoney(client, "inc", 100);
Or you can use the old method too:
Code:
new g_iAccount;
OnPluginStart()
    {
    g_iAccount= FindSendPropOffs("CCSPlayer", "m_iAccount");
    if(g_iAccount==-1)
        {
        SetFailState("OMG! What just happened there?");
        }
    }

MyFunction()
    {
    new currentvalue= GetEntData(client, g_iAccount);
    SetEntData(client,  g_iAccount, currentvalue+100);
    }
Second one is 320 characthers longer than the first one
If you have some useful stocks too, I can add them in this pack. (Yes, you will get the credit )
__________________
Shaman is offline
Send a message via ICQ to Shaman Send a message via AIM to Shaman Send a message via MSN to Shaman Send a message via Yahoo to Shaman
Peoples Army
SourceMod Donor
Join Date: Mar 2007
Old 08-17-2007 , 17:04   Re: [STOCKS] SStocks
Reply With Quote #4

im workin on some stocks too . maybbe we can work together .
Peoples Army is offline
Shaman
Senior Member
Join Date: Dec 2006
Location: Istanbul, Turkey
Old 09-15-2007 , 07:37   Re: [Stocks] SStocks
Reply With Quote #5

New version is coming soon. In the next version there will be a plugin named 'sstocks' which has some SDK stuff to make your life easier
__________________
Shaman is offline
Send a message via ICQ to Shaman Send a message via AIM to Shaman Send a message via MSN to Shaman Send a message via Yahoo to Shaman
Seather
Member
Join Date: Oct 2004
Old 12-26-2007 , 19:23   Re: [Stocks] SStocks
Reply With Quote #6

Code:
[addons/sourcemod/scripting/include/clients.inc]
Line 46 : #define MAX_NAME_LENGTH 32	/**< Maximum buffer required to store a client name */
[addons/sourcemod/scripting/include/sstocks.inc]
Line 39 : #define MAX_NAME_LENGTH 128
Seather is offline
Shaman
Senior Member
Join Date: Dec 2006
Location: Istanbul, Turkey
Old 12-28-2007 , 13:23   Re: [Stocks] SStocks
Reply With Quote #7

I fixed it in the latest version, but didn't release it. I don't know when I will release it, so you should remove it manually right now.
__________________
Shaman is offline
Send a message via ICQ to Shaman Send a message via AIM to Shaman Send a message via MSN to Shaman Send a message via Yahoo to Shaman
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 16:50.


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