Raised This Month: $32 Target: $400
 8% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-22-2015 , 14:43   Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
Reply With Quote #411

Quote:
Originally Posted by ZASTRELIS View Post
Code:
stock Entity_FindByName(const const String:name[], const String:class[]="")
{
 // ...
}
wtf? twice? Noobs..
...what are you talking about?

If you're talking about the arguments, the first is the targetname of an entity, the second is the classname.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 07-22-2015 , 18:11   Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
Reply With Quote #412

He is talking about the double const keyword, which has been fixed a year ago in the GIT repository, but it probably still in the last released zip on the website.
__________________
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
ZASTRELIS
Veteran Member
Join Date: Nov 2010
Location: Siberia, Irkutsk
Old 07-22-2015 , 20:48   Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
Reply With Quote #413

Quote:
Originally Posted by berni View Post
He is talking about the double const keyword, which has been fixed a year ago in the GIT repository, but it probably still in the last released zip on the website.
sorry, but I downloaded it from git Maybe anywhere at the hub I find old version. I don't see 0.9.11 version of this, from git and site I downloaded only 0.9.7
ZASTRELIS is offline
ZASTRELIS
Veteran Member
Join Date: Nov 2010
Location: Siberia, Irkutsk
Old 07-22-2015 , 20:54   Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
Reply With Quote #414

Quote:
Originally Posted by Chanz View Post
Since it seems you're at a loss of words for our awesome library, I'll just thank you for your support!
It isn't my lib..
ZASTRELIS is offline
ZASTRELIS
Veteran Member
Join Date: Nov 2010
Location: Siberia, Irkutsk
Old 07-22-2015 , 21:10   Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
Reply With Quote #415

In my easy lvl I fixed some mistakes (it's needed for compile killer_info_display.sp)
Already stays some warnings. I can't fix it

Code:
clients.inc(1978) : warning 213: tag mismatch
effects.inc(158) : warning 237: coercing functions to and from primitives is unsupported and will be removed in the future
CLINETS.INC
Code:
stock Client_Print(client, ClientHudPrint:destination, const String:format[], any:...) {     decl String:buffer[512], String:buffer2[254];     SetGlobalTransTarget(client);     VFormat(buffer, sizeof(buffer), format, 4);     new subject = Color_ParseChatText(buffer, buffer2, sizeof(buffer2));     if (destination == ClientHudPrint_Talk) {         Client_PrintToChatRaw(client, buffer2, subject, false);         return;     }     if ((client == 0) || (destination != ClientHudPrint_Console) || ((destination == ClientHudPrint_Console) && (GetEngineVersion() < SOURCE_SDK_LEFT4DEAD))) // In this string tag mismatch     {         Color_StripFromChatText(buffer, buffer2, sizeof(buffer2));         strcopy(buffer, sizeof(buffer), buffer2);         if (client == 0) {             PrintToServer(buffer2);             return;         }     }     new Handle:userMessage = INVALID_HANDLE;     userMessage = StartMessageOne("TextMsg", client, USERMSG_RELIABLE);     BfWriteByte(userMessage  , _:ClientHudPrint_Console);     BfWriteString(userMessage   , buffer);     EndMessage(); }

EFFECTS.INC
Code:
stock Effect_FadeOut(entity, kill=false, fast=true, EffectCallback:callback=INVALID_FUNCTION, any:data=0) {     Effect_Fade(entity, true, kill, fast, callback, data); } public Action:_smlib_Timer_Effect_Fade(Handle:Timer, Handle:dataPack) {     new entity = ReadPackCell(dataPack);     new kill = ReadPackCell(dataPack);     new EffectCallback:callback = EffectCallback:ReadPackCell(dataPack); // In this string some problem     new any:data = any:ReadPackCell(dataPack);         if (callback != INVALID_FUNCTION) {         Call_StartFunction(INVALID_HANDLE, callback);         Call_PushCell(entity);         Call_PushCell(data);         Call_Finish();     }     if (kill && IsValidEntity(entity)) {         Entity_Kill(entity);     }     return Plugin_Stop; }
Attached Files
File Type: 7z smlib_fix.7z (8.7 KB, 125 views)

Last edited by ZASTRELIS; 07-22-2015 at 21:26.
ZASTRELIS is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 07-22-2015 , 22:33   Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
Reply With Quote #416

You should just start using the latest version from github like you've been told before. There hasn't been a release for ages, so ignore the version numbers of the library.
__________________
Peace-Maker is offline
Addicted.
AlliedModders Donor
Join Date: Dec 2013
Location: 0xA9D0DC
Old 08-13-2015 , 08:44   Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
Reply With Quote #417

Client_GiveWeaponAndAmmo doesn't seem to be working again.

PHP Code:
public Action:GiveWeaponTest(clientargs)
{
    
Client_GiveWeaponAndAmmo(client"weapon_deagle"_0_1);
    
    
PrintToChat(client"[SM] You now have a deagle with one shot.")    

I get a deagle with 7/35 ammo after running the command.

Thanks for any help in advance
Addicted. is offline
ZASTRELIS
Veteran Member
Join Date: Nov 2010
Location: Siberia, Irkutsk
Old 08-14-2015 , 00:41   Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
Reply With Quote #418

Quote:
Originally Posted by oaaron99 View Post
Client_GiveWeaponAndAmmo doesn't seem to be working again.

PHP Code:
public Action:GiveWeaponTest(clientargs)
{
    
Client_GiveWeaponAndAmmo(client"weapon_deagle"_0_1);
    
    
PrintToChat(client"[SM] You now have a deagle with one shot.")    

I get a deagle with 7/35 ammo after running the command.

Thanks for any help in advance
Code:
/**  * Gives a client a weapon and ammo for that weapon.  *  * @param client        Client Index.  * @param className  Weapon Classname String.  * @param switchTo    If set to true, the client will switch the active weapon to the new weapon.  * @param primaryAmmo   Primary ammo stock value from the client, if -1 the value is untouched.  * @param secondaryAmmo Secondary ammo stock value from the client, if -1 the value is untouched.  * @param primaryClip   Primary ammo value in the weapon clip, if -1 the value is untouched.  * @param secondaryClip Secondary ammo value in the weapon clip, if -1 the value is untouched.  * @return        Entity Index of the given weapon on success, INVALID_ENT_REFERENCE on failure.  */

Last edited by ZASTRELIS; 08-14-2015 at 00:42.
ZASTRELIS is offline
Addicted.
AlliedModders Donor
Join Date: Dec 2013
Location: 0xA9D0DC
Old 08-16-2015 , 11:50   Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
Reply With Quote #419

Quote:
Originally Posted by ZASTRELIS View Post
Code:
/**  * Gives a client a weapon and ammo for that weapon.  *  * @param client        Client Index.  * @param className  Weapon Classname String.  * @param switchTo    If set to true, the client will switch the active weapon to the new weapon.  * @param primaryAmmo   Primary ammo stock value from the client, if -1 the value is untouched.  * @param secondaryAmmo Secondary ammo stock value from the client, if -1 the value is untouched.  * @param primaryClip   Primary ammo value in the weapon clip, if -1 the value is untouched.  * @param secondaryClip Secondary ammo value in the weapon clip, if -1 the value is untouched.  * @return        Entity Index of the given weapon on success, INVALID_ENT_REFERENCE on failure.  */
I understand how it works but this exact code was working before I left to go on vacation and now it gives me a full deagle:

PHP Code:
public Action:Command_EmptyDeagle(clientargs)
{
    if (
client != Warden && !CheckCommandAccess(client""ADMFLAG_UNBANtrue))
    {
        
CPrintToChat(client"[{blue}Jail{default}] You must be the {blue}Warden{default} to use this command.");
        return 
Plugin_Handled;
    }
    if (
g_iEmptyDeagles >= GetConVarInt(g_hMaxDeagles))
    {
        
CPrintToChat(client"[{blue}Jail{default}] You can only spawn %i Empty Deagles."GetConVarInt(g_hMaxDeagles));
        return 
Plugin_Handled;
    }
    
Client_GiveWeaponAndAmmo(client"weapon_deagle"_0_0);
    
g_iEmptyDeagles++;
    return 
Plugin_Handled;


Last edited by Addicted.; 08-16-2015 at 11:54.
Addicted. is offline
ZASTRELIS
Veteran Member
Join Date: Nov 2010
Location: Siberia, Irkutsk
Old 08-16-2015 , 23:42   Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
Reply With Quote #420

Try this for default values
Code:
Client_GiveWeaponAndAmmo(client, "weapon_deagle", false, -1, 7, -1, 35);
or this for test
Code:
Client_GiveWeaponAndAmmo(client, "weapon_deagle", false, -1, 1, -1, 7);

p.s. i think u don't fully understand how it works..

Last edited by ZASTRELIS; 08-16-2015 at 23:43.
ZASTRELIS 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 15:46.


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