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

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 07-12-2011 , 18:20   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #151

Cool, looks neat

Will be added when I've tested it.
__________________
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
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 07-13-2011 , 18:14   Re: SMLIB 0.9.4 BETA (278 Function Stocks) | updated 31.01.2011
Reply With Quote #152

Quote:
Originally Posted by Chanz View Post
well every author needs to be careful even with GivePlayerItem() since you can't just hope that a function is blocked by another plugin. you should always be sure and minimize function calls by filtering out unwanted clients etc.
ZR uses SDKHooks to block WeaponCanUse. Something like GivePlayerItem just spawns the entity at the client's feet and they will pick it up normally. But ZR stops the pickup of any weapon.

I think it's worthy to note that your stock for giving a weapon supercedes an engine hook that tries to block pick up of weapons. This means the client never really picks up the weapon at all. It just.. appears.


Just to clarify, I'm not saying this is a problem with either of our code.
__________________
Greyscale is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 07-13-2011 , 18:30   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #153

Well yeah, what you say isn't wrong Greyscale.

We make the tools for people, what they do with it is up to them.
smlib makes allot of things easier.. yes, but it still doesn't mean you don't have
to know what you are doing.
It's neither the fault of ZR, sdkhooks nor smlib. It's the fault of the plugin author.

Spawning weapons/item at peoples feet is more a workaround than a proper way of giving a player something, it's bugged.
ie. when people stand inside a wall or already have that item GivePlayerItem() fails to work.
__________________
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 07-14-2011 , 19:05   Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
Reply With Quote #154

It's time for a new release, we are getting closer to 1.0 stable

New smlib update available:
smlib 0.11 beta


Changes:

Quote:
  • Fixed wrong call to Client_PrintHintText() in Function Client_PrintKeyHintTextToAll()
  • Changed the buffer sizes in the Client_PrintToChat Functions to something greater.
  • Added Functions Client_PrintToConsole(), Client_Print(), Client_Reply()
  • Added Function Client_IsInAdminGroup() (original code taken from Zombie:Reloaded, thanks rhelgeby)
  • Added Functions Client_Mute() and Client_IsMuted()
  • Added Functions Client_MatchesFilter(), Client_Get(), Client_GetRandom()
  • Changed File_AddToDownloadsTable() to work with pathes ending with /
  • Changed Function Team_GetClientCount() to support client filters.
  • Added Function Team_GetClientCounts() (for optimization)
  • Changed some comments
  • Added Function Client_GetNext()
  • Added very useful macro LOOP_CLIENTS
  • Added Function Game_EndRound() (TF2 only atm)
  • Fixed Client_GetChangedButtons in clients.inc
  • Fixed Team_GetEdict() not working in Left4Dead
  • Fixed the fix for Team_GetEdict()
  • Added Macro LOOP_CLIENTWEAPONS()
  • Added Function Client_GetNextWeapon()
  • Added Comments to the Macro and new functions
  • Fixed Function Client_SetScreenOverlayForAll not looping over players correctly (Thanks to Peace-Maker)
  • Optimized strukture of Team_GetEdict() to be a bit more logic.
  • Fixed wrong tag in Function Entity_GetCollisionGroup() (thanks to miniman)
  • Fixed function Client_GiveWeaponAndAmmo() not checking -1 on clips (thanks to Peace-Maker)
  • Fixed function Client_SetMaxSpeed() (thanks to GoD-Tony)
  • Added function Client_GetMapTime() (thanks to GoD-Tony)
  • Fixed functions String_ToLower() & String_ToUpper() (thanks to rhelgeby)
  • Removed double tag in Entity_GetCollisionGroup()
  • Fixed missing CloseHandle() in Function Client_IsLookingAtWall() (thanks to databomb)
  • Added functions File_ToString(), File_StringToFile(), File_Copy() (not fully tested yet)
  • Fixed function File_Copy() (endless loop)
  • Added Function File_CopyRecursive()
  • Added Function Array_Copy()
  • Added Functions Effect_DrawBeamBoxToClient(), Effect_DrawBeamBoxToAll(), Effect_DrawBeamBox() (thanks to Peace-Maker)
  • Added Function Math_Overflow()
> Download here <

This release brings a neat feature called "Client Iteration" and Client filters.

Have a look at this example code:

PHP Code:
LOOP_CLIENTS(clientCLIENTFILTER_INGAME) {
    
PrintToServer("Client %N is ingame !"client);

LOOP_CLIENTS is a Pawn Macro Function, which allows to iterate over all
client matching the specified filter quickly and easily.
It is also designed to make as few native calls as possible, getting out
the max performance possible with this (as always ).
"client" is the client index and is only valid during the loop (if this var already exists use another name).

These are the available Clientfilters, they can be combined:

PHP Code:
#define CLIENTFILTER_ALL                0        // No filtering
#define CLIENTFILTER_BOTS            ( 1    << 1  )    // Fake clients
#define CLIENTFILTER_NOBOTS            ( 1    << 2  )    // No fake clients
#define CLIENTFILTER_AUTHORIZED        ( 1 << 3  ) // SteamID validated
#define CLIENTFILTER_NOTAUTHORIZED  ( 1 << 4  ) // SteamID not validated (yet)
#define CLIENTFILTER_ADMINS            ( 1    << 5  )    // Generic Admins (or higher)
#define CLIENTFILTER_NOADMINS        ( 1    << 6  )    // No generic admins
// All flags below require ingame checking (optimization)
#define CLIENTFILTER_INGAME            ( 1    << 7  )    // Ingame
#define CLIENTFILTER_INGAMEAUTH        ( 1 << 8  ) // Ingame & Authorized
#define CLIENTFILTER_NOTINGAME        ( 1 << 9  )    // Not ingame (currently connecting)
#define CLIENTFILTER_ALIVE            ( 1    << 10 )    // Alive
#define CLIENTFILTER_DEAD            ( 1    << 11 )    // Dead
#define CLIENTFILTER_SPECTATORS        ( 1 << 12 )    // Spectators
#define CLIENTFILTER_NOSPECTATORS    ( 1 << 13 )    // No Spectators
#define CLIENTFILTER_OBSERVERS        ( 1 << 14 )    // Observers
#define CLIENTFILTER_NOOBSERVERS    ( 1 << 15 )    // No Observers
#define CLIENTFILTER_TEAMONE        ( 1 << 16 )    // First Team (Terrorists, ...)
#define CLIENTFILTER_TEAMTWO        ( 1 << 17 )    // Second Team (Counter-Terrorists, ...) 
Multiple filters can be combined:

PHP Code:
LOOP_CLIENTS(botCLIENTFILTER_INGAME CLIENTFILTER_BOTS CLIENTFILTER_ALIVE) {
    
PrintToServer("%N is a bot, ingame and alive !"bot);

There are also other functions that supported Clientfilters now: Client_MatchesFilter(), Client_Get(), Client_GetRandom(), Team_GetClientCount()

Another macro that has been added is LOOP_CLIENTWEAPONS which iterates over a client's weapons painless:

PHP Code:
LOOP_CLIENTWEAPONS(clientweaponindex) {
    
PrintToServer("%N has weapon index %d (index %d)"clientweaponindex);

client is the index of the client you want to iterate the weapons.

Enjoy
__________________
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; 07-28-2011 at 11:00.
berni is offline
zeroibis
Veteran Member
Join Date: Jun 2007
Old 07-27-2011 , 01:39   Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
Reply With Quote #155

Can you get stock bool:Game_EndRound to work for cs:s as well this would be very nice to provide a simple unified command for ending a round and defining a winning team.
__________________
zeroibis is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 07-27-2011 , 06:31   Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
Reply With Quote #156

Quote:
Originally Posted by zeroibis View Post
Can you get stock bool:Game_EndRound to work for cs:s as well this would be very nice to provide a simple unified command for ending a round and defining a winning team.
Not without a SDKCall, and I haven't thought of a good way yet to load
a gamedata file and do calls, and keep the compatibility among different versions.
I don't even know if I want SDKCalls in smlib, if it's economic to maintain signatures & offsets.
__________________
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
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 07-27-2011 , 06:36   Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
Reply With Quote #157

Or, you could just wait for / require SourceMod 1.4.
http://hg.alliedmods.net/sourcemod-c...trike.inc#l183
__________________
asherkin is offline
zeroibis
Veteran Member
Join Date: Jun 2007
Old 07-27-2011 , 16:42   Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
Reply With Quote #158

Quote:
Originally Posted by asherkin View Post
Or, you could just wait for / require SourceMod 1.4.
http://hg.alliedmods.net/sourcemod-c...trike.inc#l183
Thank GOD! Native support is going to be great!
__________________
zeroibis is offline
zeroibis
Veteran Member
Join Date: Jun 2007
Old 07-27-2011 , 16:48   Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
Reply With Quote #159

Can you possible change the name of stock Entity_SetHealth as it appears to conflict with war3source by throwing the error:
Quote:
SourcePawn Compiler 1.3.7-dev
Copyright (c) 1997-2006, ITB CompuPhase, (C)2004-2008 AlliedModders, LLC

G:\Pawn Studio\compiler\include\smlib/entities.inc(1261) : error 025: function heading differs from prototype
G:\Pawn Studio\compiler\include\smlib/entities.inc(1262) : error 021: symbol already defined: "Entity_SetHealth"

2 Errors.

Compilation Time: 2.10 sec
Note that this program complied fine previously.

For now I have simply removed Entity_SetHealth from entities.inc in order to allow my war3 plugins to compile.
__________________
zeroibis is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 07-27-2011 , 17:37   Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
Reply With Quote #160

You are kidding me, right ?
I'm not gonna change a function name just because some plugin has a
function with the same name, the name was obviously copied from smlib, because it doesn't have any other Entity_ functions.

Blame the author ?
__________________
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
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 01:36.


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