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
miniman
Senior Member
Join Date: Aug 2009
Location: Israel
Old 04-28-2011 , 06:04   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #141

is that possible to add TerminateRound for CSS?
would be very useful
miniman is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 04-28-2011 , 06:28   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #142

No, unfortunately CS:S doesn't provide an entity for ending a round.
The only way would be with a signature/symbol and smlib doesn't use SDKCalls.
__________________
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
miniman
Senior Member
Join Date: Aug 2009
Location: Israel
Old 04-28-2011 , 16:30   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #143

Quote:
Originally Posted by berni View Post
No, unfortunately CS:S doesn't provide an entity for ending a round.
The only way would be with a signature/symbol and smlib doesn't use SDKCalls.
any good reason why?
well I can give you the sig if you need it
miniman is offline
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 05-15-2011 , 17:56   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #144

Was using smlibs and noticed this:
Code:
stock Client_SetMaxSpeed(client, Float:value) {     Client_SetMaxSpeed(client, value); }

Maybe I can add a new one while I'm posting:
Code:
Float:GetClientMapTime(client) {     /* Retrieves the time played on the current map. */     new Float:fClientTime = GetClientTime(client);     new Float:fGameTime = GetGameTime();     return (fClientTime < fGameTime) ? fClientTime : fGameTime; }
GoD-Tony is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 05-15-2011 , 18:09   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #145

Quote:
Originally Posted by GoD-Tony View Post
Was using smlibs and noticed this:
Code:
stock Client_SetMaxSpeed(client, Float:value) { &nbsp;&nbsp;&nbsp;&nbsp;Client_SetMaxSpeed(client, value); }
It should call Entity_SetMaxSpeed, fixed on svn.
You can use Entity_SetMaxSpeed in the meanwhile, Client_SetMaxSpeed ist just a wrapper


Quote:
Originally Posted by GoD-Tony View Post
Was using smlibs and noticed this:
Maybe I can add a new one while I'm posting:
Code:
Float:GetClientMapTime(client) { &nbsp;&nbsp;&nbsp;&nbsp;/* Retrieves the time played on the current map. */ &nbsp;&nbsp;&nbsp;&nbsp;new Float:fClientTime = GetClientTime(client); &nbsp;&nbsp;&nbsp;&nbsp;new Float:fGameTime = GetGameTime(); &nbsp;&nbsp;&nbsp;&nbsp;return (fClientTime < fGameTime) ? fClientTime : fGameTime; }
Added function Client_GetMapTime()
__________________
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
FunkyLoveCow
Senior Member
Join Date: May 2010
Old 06-14-2011 , 16:57   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #146

The SVN repository is asking for a username and password.
FunkyLoveCow is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 06-17-2011 , 21:34   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #147

The webhost was moved a while ago, should be fixed now

Greetings ~Berni
__________________
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
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 06-21-2011 , 13:55   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #148

Logic mistake in String_ToLower and String_ToUpper. They only write changed characters back to the output. A string with just lowercase letters passed to String_ToLower will give empty output.

It's Fixed by adding a else statement and passing the value directly from input to output (same applies to String_ToUpper):
PHP Code:
/**
 * Converts the whole String to lower case.
 * Only works with alphabetical characters (not ÖÄÜ) because Sourcemod suxx !
 * The Output String can be the same as the Input String.
 *
 * @param input                Input String.
 * @param output            Output String.
 * @param size                Max Size of the Output string
 * @noreturn
 */
stock String_ToLower(const String:input[], String:output[], size)
{
    
size--;

    new 
x=0;
    while (
input[x] != '\0' || size) {
        
        if (
IsCharUpper(input[x])) {
            
output[x] = CharToLower(input[x]);
        }
        else {
            
// Lowercase letter or another symbol. Pass it directly to output.
            
output[x] = input[x];
        }
        
        
x++;
    }
    
    
output[x] = '\0';

Btw, you don't really need to write '\0'. It's exactly the same as writing just 0. The escape sequence may add a little noise in the code so it's harder to read. Remember that characters are numbers.
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)
rhelgeby is offline
Send a message via MSN to rhelgeby
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 06-21-2011 , 15:16   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #149

Yeah, changed

Quote:
Originally Posted by rhelgeby View Post
Btw, you don't really need to write '\0'. It's exactly the same as writing just 0. The escape sequence may add a little noise in the code so it's harder to read. Remember that characters are numbers.
Since we are dealing with characters we also handle the string terminator as one ^^ I don't think it confuses anyone because this sequence is well known.
__________________
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
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 07-12-2011 , 18:06   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #150

I'm using those stocks quite often lately.
They're used to draw a box of lasers limited by two diagonally opposite points as edges.

Would be great to have them included, so i don't need to paste them all the time

[IMG]http://img843.**************/img843/9093/antirusheditzone.th.jpg[/IMG]

PHP Code:
/**
 * Sends a boxed beam effect to one player.
 * 
 * Ported from eventscripts vecmath library.
 *
 * @param client        The client to show the box to.
 * @param uppercorner    One upper corner of the box.
 * @param bottomcorner    One bottom corner of the box.
 * @param ModelIndex    Precached model index.
 * @param HaloIndex        Precached model index.
 * @param StartFrame    Initital frame to render.
 * @param FrameRate        Beam frame rate.
 * @param Life            Time duration of the beam.
 * @param Width            Initial beam width.
 * @param EndWidth        Final beam width.
 * @param FadeLength    Beam fade time duration.
 * @param Amplitude        Beam amplitude.
 * @param color            Color array (r, g, b, a).
 * @param Speed            Speed of the beam.
 * @noreturn
 */
stock TE_SendBeamBoxToClient(client, const Float:uppercorner[3], const Float:bottomcorner[3], ModelIndexHaloIndexStartFrameFrameRateFloat:LifeFloat:WidthFloat:EndWidthFadeLengthFloat:Amplitude, const Color[4], Speed)
{
    new 
clients[1];
    
clients[0] = client;
    
TE_SendBeamBox(clients1uppercornerbottomcornerModelIndexHaloIndexStartFrameFrameRateLifeWidthEndWidthFadeLengthAmplitudeColorSpeed);
}

/**
 * Sends a boxed beam effect to all players.
 * 
 * Ported from eventscripts vecmath library.
 *
 * @param uppercorner    One upper corner of the box.
 * @param bottomcorner    One bottom corner of the box.
 * @param ModelIndex    Precached model index.
 * @param HaloIndex        Precached model index.
 * @param StartFrame    Initital frame to render.
 * @param FrameRate        Beam frame rate.
 * @param Life            Time duration of the beam.
 * @param Width            Initial beam width.
 * @param EndWidth        Final beam width.
 * @param FadeLength    Beam fade time duration.
 * @param Amplitude        Beam amplitude.
 * @param color            Color array (r, g, b, a).
 * @param Speed            Speed of the beam.
 * @noreturn
 */
stock TE_SendBeamBoxToAll(const Float:uppercorner[3], const Float:bottomcorner[3], ModelIndexHaloIndexStartFrameFrameRateFloat:LifeFloat:WidthFloat:EndWidthFadeLengthFloat:Amplitude, const Color[4], Speed)
{
    new 
total 0;
    new 
clients[MaxClients];
    for (new 
i=1i<=MaxClientsi++)
    {
        if (
IsClientInGame(i))
        {
            
clients[total++] = i;
        }
    }
    
TE_SendBeamBox(clientstotaluppercornerbottomcornerModelIndexHaloIndexStartFrameFrameRateLifeWidthEndWidthFadeLengthAmplitudeColorSpeed);
}

/**
 * Sends a boxed beam effect to a list of players.
 * 
 * Ported from eventscripts vecmath library.
 *
 * @param clients        An array of clients to show the box to.
 * @param numClients    Number of players in the array.
 * @param uppercorner    One upper corner of the box.
 * @param bottomcorner    One bottom corner of the box.
 * @param ModelIndex    Precached model index.
 * @param HaloIndex        Precached model index.
 * @param StartFrame    Initital frame to render.
 * @param FrameRate        Beam frame rate.
 * @param Life            Time duration of the beam.
 * @param Width            Initial beam width.
 * @param EndWidth        Final beam width.
 * @param FadeLength    Beam fade time duration.
 * @param Amplitude        Beam amplitude.
 * @param color            Color array (r, g, b, a).
 * @param Speed            Speed of the beam.
 * @noreturn
 */
stock TE_SendBeamBox(clients[], numClients, const Float:uppercorner[3], const Float:bottomcorner[3], ModelIndexHaloIndexStartFrameFrameRateFloat:LifeFloat:WidthFloat:EndWidthFadeLengthFloat:Amplitude, const Color[4], Speed)
{
    
// Create the additional corners of the box
    
new Float:tc1[3];
    
AddVectors(tc1uppercornertc1);
    
tc1[0] = bottomcorner[0];
    new 
Float:tc2[3];
    
AddVectors(tc2uppercornertc2);
    
tc2[1] = bottomcorner[1];
    new 
Float:tc3[3];
    
AddVectors(tc3uppercornertc3);
    
tc3[2] = bottomcorner[2];
    new 
Float:tc4[3];
    
AddVectors(tc4bottomcornertc4);
    
tc4[0] = uppercorner[0];
    new 
Float:tc5[3];
    
AddVectors(tc5bottomcornertc5);
    
tc5[1] = uppercorner[1];
    new 
Float:tc6[3];
    
AddVectors(tc6bottomcornertc6);
    
tc6[2] = uppercorner[2];
    
    
// Draw all the edges
    
TE_SetupBeamPoints(uppercornertc1ModelIndexHaloIndexStartFrameFrameRateLifeWidthEndWidthFadeLengthAmplitudeColorSpeed);
    
TE_Send(clientsnumClients);
    
TE_SetupBeamPoints(uppercornertc2ModelIndexHaloIndexStartFrameFrameRateLifeWidthEndWidthFadeLengthAmplitudeColorSpeed);
    
TE_Send(clientsnumClients);
    
TE_SetupBeamPoints(uppercornertc3ModelIndexHaloIndexStartFrameFrameRateLifeWidthEndWidthFadeLengthAmplitudeColorSpeed);
    
TE_Send(clientsnumClients);
    
TE_SetupBeamPoints(tc6tc1ModelIndexHaloIndexStartFrameFrameRateLifeWidthEndWidthFadeLengthAmplitudeColorSpeed);
    
TE_Send(clientsnumClients);
    
TE_SetupBeamPoints(tc6tc2ModelIndexHaloIndexStartFrameFrameRateLifeWidthEndWidthFadeLengthAmplitudeColorSpeed);
    
TE_Send(clientsnumClients);
    
TE_SetupBeamPoints(tc6bottomcornerModelIndexHaloIndexStartFrameFrameRateLifeWidthEndWidthFadeLengthAmplitudeColorSpeed);
    
TE_Send(clientsnumClients);
    
TE_SetupBeamPoints(tc4bottomcornerModelIndexHaloIndexStartFrameFrameRateLifeWidthEndWidthFadeLengthAmplitudeColorSpeed);
    
TE_Send(clientsnumClients);
    
TE_SetupBeamPoints(tc5bottomcornerModelIndexHaloIndexStartFrameFrameRateLifeWidthEndWidthFadeLengthAmplitudeColorSpeed);
    
TE_Send(clientsnumClients);
    
TE_SetupBeamPoints(tc5tc1ModelIndexHaloIndexStartFrameFrameRateLifeWidthEndWidthFadeLengthAmplitudeColorSpeed);
    
TE_Send(clientsnumClients);
    
TE_SetupBeamPoints(tc5tc3ModelIndexHaloIndexStartFrameFrameRateLifeWidthEndWidthFadeLengthAmplitudeColorSpeed);
    
TE_Send(clientsnumClients);
    
TE_SetupBeamPoints(tc4tc3ModelIndexHaloIndexStartFrameFrameRateLifeWidthEndWidthFadeLengthAmplitudeColorSpeed);
    
TE_Send(clientsnumClients);
    
TE_SetupBeamPoints(tc4tc2ModelIndexHaloIndexStartFrameFrameRateLifeWidthEndWidthFadeLengthAmplitudeColorSpeed);
    
TE_Send(clientsnumClients);

__________________
Peace-Maker 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 03:43.


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