Raised This Month: $ Target: $400
 0% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
Chanz
Veteran Member
Join Date: Aug 2008
Location: Germany - Stuttgart
Old 02-02-2011 , 08:18   Re: SMLIB 0.9.4 BETA (278 Function Stocks) | updated 31.01.2011
Reply With Quote #51

I've never worked with ZR, but if you don't want to give a zombie a weapon, then check if the client is a zombie and don't give it to him.

It would be bad to add an automatic check only for ZR, imagine we need to do this for as example Hide and Seek and every other mod/plugin etc. even if its only for Client_GiveWeapon, its performance would drop extreamly to check these, not to mention the work to keep everything working.
__________________
[ 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 02-02-2011 , 09:21   Re: SMLIB 0.9.4 BETA (278 Function Stocks) | updated 31.01.2011
Reply With Quote #52

Quote:
Originally Posted by zeroibis View Post
For example you can use this command to give a zombie weapons in a ZR server.
It's a Function, not a Command.
I don't know much about ZR either, but the Scripter is responsible himself who he calls this function on,
there are maybe coders who do want to give weapons to zombies, implementing a restriction would be a bad idea.
__________________
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
zeroibis
Veteran Member
Join Date: Jun 2007
Old 02-02-2011 , 15:05   Re: SMLIB 0.9.4 BETA (278 Function Stocks) | updated 31.01.2011
Reply With Quote #53

Oh I am not requesting it be made to work like that I am only stating that functionally it does not work the same as GivePlayerItem() and that programers should be careful which one they use depending on the situation.
__________________
zeroibis is offline
Chanz
Veteran Member
Join Date: Aug 2008
Location: Germany - Stuttgart
Old 02-02-2011 , 16:55   Re: SMLIB 0.9.4 BETA (278 Function Stocks) | updated 31.01.2011
Reply With Quote #54

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.
__________________
[ SourceModPlugins.org ][ My Plugins ]

Thank you for donations: [ Paypal ]

Video Tutorial (German): [ Gameserver & SourceMod Plugins mit HLSW verwalten ]
Chanz is offline
zeroibis
Veteran Member
Join Date: Jun 2007
Old 02-02-2011 , 17:19   Re: SMLIB 0.9.4 BETA (278 Function Stocks) | updated 31.01.2011
Reply With Quote #55

Question: is Math_GetRandomInt(min, max); inclusive?

In that are min and max possible outputs for this function or only values between them. Same for the Math_GetRamdomFloat...
__________________
zeroibis is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 02-02-2011 , 17:30   Re: SMLIB 0.9.4 BETA (278 Function Stocks) | updated 31.01.2011
Reply With Quote #56

Quote:
Originally Posted by zeroibis View Post
Question: is Math_GetRandomInt(min, max); inclusive?

In that are min and max possible outputs for this function or only values between them. Same for the Math_GetRamdomFloat...
yes, it is inclusive, min and max are also part of the range.

Another note on GivePlayerItem(), this function is not very safe, as it spawns
a weapon or an item at the players position and hopes the player touches it.
If the player is currently inside a wall or does already have that item, the item would be dropped to the floor.
__________________
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
zeroibis
Veteran Member
Join Date: Jun 2007
Old 02-02-2011 , 17:57   Re: SMLIB 0.9.4 BETA (278 Function Stocks) | updated 31.01.2011
Reply With Quote #57

Cool thanks!

Also yes I know of the GivePlayerItem() issue which is why I strip weapons or check to see if they have what I am giving before use.
__________________
zeroibis is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 02-02-2011 , 18:46   Re: SMLIB 0.9.6 BETA (289 Function Stocks) | updated 03.02.2011
Reply With Quote #58

New smlib update available: smlib 0.9.6 beta
Important Note:
SVN folder structure has been changed.

Compatibility breaks: yes

Changes:

Quote:
  • Added Client button stock functions.
  • Created a plugin file smlib_test to compile all functions at once.
  • Fixed a shitload of compile errors / warnings.
  • Added Function Client_IsLookingAtWall()
  • Added Functions Client_GetClass() and Client_SetClass()
  • Corrected some function descriptions
  • Fixed Function Entity_HasSpawnFlags() (missing ()), thanks naris
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
FeuerSturm
AlliedModders Donor
Join Date: Apr 2004
Old 02-03-2011 , 00:36   Re: SMLIB 0.9.6 BETA (289 Function Stocks) | updated 03.02.2011
Reply With Quote #59

Berni, you might want to take a look at this stock in clients.inc:

Code:
/**
 * Gets the name of the last place (if set by the game)
 *
 * @param entity			Entity index.
 * @param buffer			String buffer
 * @param size				Size of the String buffer
 * @noreturn
 */
stock Client_GetLastPlaceName(client, String:buffer[], size)
{
	SetEntPropString(client, Prop_Send, "m_szLastPlaceName", buffer);
}
FeuerSturm is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 02-03-2011 , 00:50   Re: SMLIB 0.9.6 BETA (289 Function Stocks) | updated 03.02.2011
Reply With Quote #60

ok "S" should be "G" commited to svn.
__________________
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 22:21.


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