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

SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011


Post New Thread Reply   
 
Thread Tools Display Modes
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 03-03-2011 , 09:24   Re: SMLIB 0.10.0 BETA (over 300 Function Stocks) | updated 26.02.2011
Reply With Quote #101

Quote:
Originally Posted by KawMAN View Post
Hi,

Please add something like Team_FindByName that return team index of team with specific name or -1 when can't find.

Also in teams.inc function Team_GetEdict(index)
PHP Code:
        if (!Entity_ClassNameMatches(entity"team_manager"true)) {
            return -
1;
        } 
instead "return -1;" should't be "continue;" ?
It's not meant to iterate over all entities, the team entities are all sitting after MaxClients+1.

I can add Team_FindByName() for completion, but you can use FindTeamByName like asherkin said.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 03-06-2011 , 18:20   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #102

New smlib update available: smlib 0.10.1 beta
Compatibility breaks: yes

I added a useful documentation on how to use smlib's color API: Click Me!

Changes:

Quote:
  • Added file concommands.inc
  • Added ConCommand Functions ConCommand_HasFlags(), ConCommand_AddFlags(),
    ConCommand_RemoveFlags() (Thanks to Fatony)
  • Added support for DoD:S nickname coloring to Client_PrintToChatRaw()
  • Added Parameter isChat to all Client_PrintToChat() functions
  • Fixed a bug in color parsing code
  • Enhanced color code and gamedata support
  • Added gamedata/smlib_colors.games.txt (color overriding)
Download here.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 03-06-2011 , 19:56   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #103

New smlib update available: smlib 0.10.2 beta
Compatibility breaks: no

Changes:
Quote:
  • Fixed L4D2/TF2 color settings (reported in IRC)

Download here.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 03-08-2011 , 03:54   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #104

I would like to see this stock in SMLIB. It's from the Zombie:Reloaded plugin (all credit to them), and I use it regularly to check if a player is in a particular group.

PHP Code:
/**
 * Returns whether a player is in a spesific group or not.
 *
 * @param client        The client index.
 * @param groupName     SourceMod group name to check.
 * @return              True if in the group, false otherwise.
 */
stock bool:Client_IsInGroup(client, const String:groupName[])
{
    new 
AdminId:id GetUserAdmin(client);
    
    
// Validate id.
    
if (id == INVALID_ADMIN_ID)
    {
        return 
false;
    }
    
    
// Get number of groups.
    
new groupnum GetAdminGroupCount(id);
    
decl String:groupname[64];
    
    
// Validate number of groups.
    
if (groupnum 0)
    {
        
// Loop through each group.
        
for (new group 0group groupnumgroup++)
        {
            
// Get group name.
            
GetAdminGroup(idgroupgroupnamesizeof(groupname));
            
            
// Compare names.
            
if (StrEqual(groupNamegroupnamefalse))
            {
                return 
true;
            }
        }
    }
    
    
// No groups or no match.
    
return false;

GoD-Tony is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 03-08-2011 , 04:30   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #105

Sure, I'm gonna add this one
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
Steell
SourceMod Donor
Join Date: Mar 2009
Old 03-09-2011 , 12:35   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #106

For some reason this code won't compile, even on your online compiler: http://p.hlxce.com/291

It keeps saying it can't find Client_HasWeapon, even though it is listed in smlib/clients.inc.

EDIT: Also, Client_HasWeapon should return a bool (you forgot the tag).
__________________

Last edited by Steell; 03-09-2011 at 12:41.
Steell is offline
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 03-09-2011 , 14:33   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #107

Quote:
Originally Posted by Steell View Post
For some reason this code won't compile, even on your online compiler: http://p.hlxce.com/291
Compiles fine for me (smlib 0.10.1). Make sure your include file is in scripting/include/smlib/clients.inc.
GoD-Tony is offline
Steell
SourceMod Donor
Join Date: Mar 2009
Old 03-09-2011 , 14:46   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #108

Yep the include files are in the correct place. The weird thing is that it's also not compiling on the "web IDE" that berni posted in the OP.
__________________
Steell is offline
Chanz
Veteran Member
Join Date: Aug 2008
Location: Germany - Stuttgart
Old 03-09-2011 , 15:19   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #109

Seems like anywhere is a { or } missing/double.
Sorry can't locate it atm, but it seems its in the clients.inc since #include <smlib/clients> brings up the same error.
__________________
[ SourceModPlugins.org ][ My Plugins ]

Thank you for donations: [ Paypal ]

Video Tutorial (German): [ Gameserver & SourceMod Plugins mit HLSW verwalten ]
Chanz is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 03-09-2011 , 17:17   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #110

Quote:
Originally Posted by Steell View Post
For some reason this code won't compile, even on your online compiler: http://p.hlxce.com/291

It keeps saying it can't find Client_HasWeapon, even though it is listed in smlib/clients.inc.

EDIT: Also, Client_HasWeapon should return a bool (you forgot the tag).
That's pretty weird, it seems to work fine in th windows compiler, but on linux it just fails and I can't figure out why. Are you using the linux compiler ?

Edit: I don't know why, but somehow the linux compiler doesn't seem to like include directorys, it includes the sm clients.inc, instead of the smlib one.

Edit2: Changing <smlib/clients> to <smlib/clients.inc> seems to help, I'm gonna change all includes in the next smlib release.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0

Last edited by berni; 03-09-2011 at 17:32.
berni 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 19:57.


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