AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011 (https://forums.alliedmods.net/showthread.php?t=148387)

ImACow 05-11-2015 18:51

Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
 
Recent csgo patch broke the reserve ammo, can you update smlib to account for this ?
Thanks

Chanz 05-11-2015 19:49

Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
 
There is a pull request for the CS:GO reserve ammo, see: https://github.com/bcserv/smlib/pull/32

Roker 06-15-2015 16:50

Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
 
stock Entity_FindByName(const const String:name[], const String:class[]="");

Gives an error because there are two const.

Seems to be fixed in the github. I'll just download from there.

Clamouzes 06-16-2015 01:23

Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
 
Hello,

I want compile a puglin but i have this text "fatal error 182: cannot read from file: "smlib"".

Addicted. 06-16-2015 08:53

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

Originally Posted by Clamouzes (Post 2308346)
Hello,

I want compile a puglin but i have this text "fatal error 182: cannot read from file: "smlib"".

Have you placed smlib.inc in your /include directory?

Clamouzes 06-16-2015 11:50

Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
 
Yes, i have a smlib.inc in folder include.

Addicted. 06-16-2015 11:55

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

Originally Posted by Clamouzes (Post 2308530)
Yes, i have a smlib.inc in folder include.

Could you show us how you are including the file?

ie: paste the top of your code

Clamouzes 06-16-2015 13:40

Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
 
It's okay, puglin compile correctly, ty bro.

ZASTRELIS 07-21-2015 22:57

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

stock Entity_FindByName(const const String:name[], const String:class[]="")
{
 // ...
}

wtf? twice? Noobs..

Chanz 07-22-2015 14:40

Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
 
Since it seems you're at a loss of words for our awesome library, I'll just thank you for your support! :)

Powerlord 07-22-2015 14:43

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

Originally Posted by ZASTRELIS (Post 2322892)
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.

berni 07-22-2015 18:11

Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
 
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.

ZASTRELIS 07-22-2015 20:48

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

Originally Posted by berni (Post 2323293)
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 :bee: 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 07-22-2015 20:54

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

Originally Posted by Chanz (Post 2323224)
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 07-22-2015 21:10

Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
 
1 Attachment(s)
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; }

Peace-Maker 07-22-2015 22:33

Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
 
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.

Addicted. 08-13-2015 08:44

Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
 
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

ZASTRELIS 08-14-2015 00:41

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

Originally Posted by oaaron99 (Post 2332664)
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.  */

Addicted. 08-16-2015 11:50

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

Originally Posted by ZASTRELIS (Post 2332932)
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;



ZASTRELIS 08-16-2015 23:42

Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
 
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..

Addicted. 08-17-2015 08:26

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

Originally Posted by ZASTRELIS (Post 2333926)
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..

Both of those give me a full deagle.

PHP Code:

public OnPluginStart() 
{
    
RegAdminCmd("sm_givedeagle"GiveWeaponADMFLAG_GENERIC);
    
RegAdminCmd("sm_givedeagletest"GiveWeaponTestADMFLAG_GENERIC);
}    

public 
Action:GiveWeapon(clientargs)
{
    
Client_GiveWeaponAndAmmo(client"weapon_deagle"false, -17, -135);
}

public 
Action:GiveWeaponTest(clientargs)
{
    
Client_GiveWeaponAndAmmo(client"weapon_deagle"false, -11, -17);    


p.s. i'm sure I don't..

ZASTRELIS 08-18-2015 07:19

Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
 
maibe it's offset problem.. I don't know too =)

Prof. Orribilus 08-22-2015 08:50

Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
 
I spot the following compile errors:
Code:

smlib/entities.inc(33) : error 138: const was specified twice
smlib/crypt.inc(426) : error 173: 'in' is a newly reserved keyword that may be used in the future; use a different name as an identifier
smlib/effects.inc(158) : warning 237: coercing functions to and from primitives is unsupported and will be removed in the future

Thanks for your work



Update:
Never mind, i have downloaded the updated version from GitHub.

Prof. Orribilus 08-30-2015 04:26

Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
 
The website is not accessible.

zipcore 08-30-2015 16:26

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

Originally Posted by Prof. Orribilus (Post 2335804)
Update:
Never mind, i have downloaded the updated version from GitHub.

https://github.com/bcserv/smlib If someone needs the link :P

Transit Of Venus 09-03-2015 02:56

Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
 
And the Images broke...

Chanz 09-11-2015 18:38

Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
 
A little late to let you know, but we are working on the certificate error.

Try https://sourcemodplugins.org/smlib/ without the www and you can skip the warning (at least in FireFox).

Prof. Orribilus 09-12-2015 08:37

Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
 
Ok, thanks.

Remy Lebeau 09-22-2015 01:33

Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
 
Anyone have any ideas as to why since I've updated my SM installation, attempting to compile any plugin that uses smlib is giving me a bunch of errors?

eg:

Code:

SourcePawn Compiler 1.7.3-dev+5255
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2014 AlliedModders LLC

c:\Development\War3Source\scripting\include\smlib/entities.inc(33) : error 138: const was specified twice
c:\Development\War3Source\scripting\include\smlib/colors.inc(154) : error 157: 'char' is a reserved keyword
c:\Development\War3Source\scripting\include\smlib/colors.inc(157) : error 029: invalid expression, assumed zero
c:\Development\War3Source\scripting\include\smlib/colors.inc(162) : error 029: invalid expression, assumed zero
c:\Development\War3Source\scripting\include\smlib/colors.inc(176) : error 029: invalid expression, assumed zero
c:\Development\War3Source\scripting\include\smlib/colors.inc(179) : error 029: invalid expression, assumed zero
c:\Development\War3Source\scripting\include\smlib/colors.inc(184) : error 029: invalid expression, assumed zero
c:\Development\War3Source\scripting\include\smlib/colors.inc(187) : error 029: invalid expression, assumed zero
c:\Development\War3Source\scripting\include\smlib/colors.inc(191) : error 029: invalid expression, assumed zero
c:\Development\War3Source\scripting\include\smlib/colors.inc(154) : warning 204: symbol is assigned a value that is never used: "char"
c:\Development\War3Source\scripting\include\smlib/colors.inc(239) : error 157: 'char' is a reserved keyword
c:\Development\War3Source\scripting\include\smlib/colors.inc(241) : error 029: invalid expression, assumed zero
c:\Development\War3Source\scripting\include\smlib/colors.inc(242) : error 029: invalid expression, assumed zero
c:\Development\War3Source\scripting\include\smlib/colors.inc(239) : warning 204: symbol is assigned a value that is never used: "char"
c:\Development\War3Source\scripting\include\smlib/crypt.inc(426) : error 173: 'in' is a newly reserved keyword that may be used in the future; use a different name as an identifier
c:\Development\War3Source\scripting\include\smlib/effects.inc(158) : warning 237: coercing functions to and from primitives is unsupported and will be removed in the future

Code:

SourcePawn Compiler 1.7.3-dev+5255
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2014 AlliedModders LLC

c:\Development\War3Source\scripting\include\smlib/entities.inc(33) : error 138: const was specified twice
c:\Development\War3Source\scripting\include\smlib/crypt.inc(426) : error 173: 'in' is a newly reserved keyword that may be used in the future; use a different name as an identifier
c:\Development\War3Source\scripting\include\smlib/effects.inc(158) : warning 237: coercing functions to and from primitives is unsupported and will be removed in the future


versatile_bfg 09-22-2015 01:38

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

Originally Posted by Remy Lebeau (Post 2345760)
Anyone have any ideas as to why since I've updated my SM installation, attempting to compile any plugin that uses smlib is giving me a bunch of errors?

eg:

Code:

SourcePawn Compiler 1.7.3-dev+5255
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2014 AlliedModders LLC

c:\Development\War3Source\scripting\include\smlib/entities.inc(33) : error 138: const was specified twice
c:\Development\War3Source\scripting\include\smlib/colors.inc(154) : error 157: 'char' is a reserved keyword
c:\Development\War3Source\scripting\include\smlib/colors.inc(157) : error 029: invalid expression, assumed zero
c:\Development\War3Source\scripting\include\smlib/colors.inc(162) : error 029: invalid expression, assumed zero
c:\Development\War3Source\scripting\include\smlib/colors.inc(176) : error 029: invalid expression, assumed zero
c:\Development\War3Source\scripting\include\smlib/colors.inc(179) : error 029: invalid expression, assumed zero
c:\Development\War3Source\scripting\include\smlib/colors.inc(184) : error 029: invalid expression, assumed zero
c:\Development\War3Source\scripting\include\smlib/colors.inc(187) : error 029: invalid expression, assumed zero
c:\Development\War3Source\scripting\include\smlib/colors.inc(191) : error 029: invalid expression, assumed zero
c:\Development\War3Source\scripting\include\smlib/colors.inc(154) : warning 204: symbol is assigned a value that is never used: "char"
c:\Development\War3Source\scripting\include\smlib/colors.inc(239) : error 157: 'char' is a reserved keyword
c:\Development\War3Source\scripting\include\smlib/colors.inc(241) : error 029: invalid expression, assumed zero
c:\Development\War3Source\scripting\include\smlib/colors.inc(242) : error 029: invalid expression, assumed zero
c:\Development\War3Source\scripting\include\smlib/colors.inc(239) : warning 204: symbol is assigned a value that is never used: "char"
c:\Development\War3Source\scripting\include\smlib/crypt.inc(426) : error 173: 'in' is a newly reserved keyword that may be used in the future; use a different name as an identifier
c:\Development\War3Source\scripting\include\smlib/effects.inc(158) : warning 237: coercing functions to and from primitives is unsupported and will be removed in the future

Code:

SourcePawn Compiler 1.7.3-dev+5255
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2014 AlliedModders LLC

c:\Development\War3Source\scripting\include\smlib/entities.inc(33) : error 138: const was specified twice
c:\Development\War3Source\scripting\include\smlib/crypt.inc(426) : error 173: 'in' is a newly reserved keyword that may be used in the future; use a different name as an identifier
c:\Development\War3Source\scripting\include\smlib/effects.inc(158) : warning 237: coercing functions to and from primitives is unsupported and will be removed in the future


read the errors... It tells you why.
There was a lot of changes from 1.6 to 1.7 that reserved words and other things as well.

Remy Lebeau 09-22-2015 02:10

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

Originally Posted by versatile_bfg (Post 2345762)
read the errors... It tells you why.
There was a lot of changes from 1.6 to 1.7 that reserved words and other things as well.

I feel I should rephrase my question...

Is there an update planned for SMLIB that will address these issues (as these appear to be conflicts between SMlib and SM)?

Or do I have to removed smlib from my plugins?

Wliu 09-22-2015 09:10

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

Originally Posted by Remy Lebeau (Post 2345768)
I feel I should rephrase my question...

Is there an update planned for SMLIB that will address these issues (as these appear to be conflicts between SMlib and SM)?

Or do I have to removed smlib from my plugins?

https://github.com/bcserv/smlib. I don't think this thread has been updated in forever.

Chaya_ 12-08-2015 09:21

Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
 
/include/smlib/entities.inc(33) : error 138: const was specified twice

Godis 12-08-2015 14:09

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

Originally Posted by Chaya_ (Post 2369888)
/include/smlib/entities.inc(33) : error 138: const was specified twice

Did you download smlib from their website? If so go to their github repo and download that instead, the latest release on their website hasn't been updated in ages and it won't compile.

_GamerX 01-11-2017 17:10

Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
 
work in CS:GO without errors?

sneaK 01-11-2017 17:32

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

Originally Posted by _GamerX (Post 2485640)
work in CS:GO without errors?

Yes. Get the latest version from https://github.com/bcserv/smlib

condolent 08-16-2017 07:09

Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
 
Does this have some smart way to set a beacon on a client, like the one in the admin menu?

Sithranduil 08-16-2017 14:22

Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
 
Hi, you can do it with a TE : https://sm.alliedmods.net/new-api/sd...pBeamRingPoint

TheXeon 01-31-2018 05:03

Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
 
I went ahead and updated SMLIB to as much of the new syntax as I could find/think of at 2am, as well as correct some of the documentation to reflect what was actually happening in the functions. This should fix some of the compile errors others were having but may not fix any potentially old code that has changed since the original SMLIB was made.

https://github.com/NGSNetwork/sm-plu...lude/smlib.inc
and everything in this folder:
https://github.com/NGSNetwork/sm-plu.../include/smlib

I'd recommend downloading the repo as a zip and only taking what you may need.

sneaK 01-31-2018 12:32

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

Originally Posted by TheXeon (Post 2575403)
I went ahead and updated SMLIB to as much of the new syntax as I could find/think of at 2am, as well as correct some of the documentation to reflect what was actually happening in the functions. This should fix some of the compile errors others were having but may not fix any potentially old code that has changed since the original SMLIB was made.

https://github.com/NGSNetwork/sm-plu...lude/smlib.inc
and everything in this folder:
https://github.com/NGSNetwork/sm-plu.../include/smlib

I'd recommend downloading the repo as a zip and only taking what you may need.

Nice, you should send a PR to the main repo with that!


All times are GMT -4. The time now is 21:59.

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