Raised This Month: $7 Target: $400
 1% 

SourceMod 1.7.1 Released


Post New Thread Closed Thread   
 
Thread Tools Display Modes
psychonic

BAFFLED
Join Date: May 2008
Old 04-20-2015 , 06:52   Re: SourceMod 1.7.1 Released
#11

Quote:
Originally Posted by Electr000999 View Post
i am put line "#pragma newdecls required" after include's and after experiments get error..
  • why we cannot create custom native with type not a int type, may be beacuse by this in .inc files
    Code:
    native CreateNative(const String:name[], NativeCall:func); 
    typedef NativeCall = function int (Handle plugin, int numParams)
    for example how get error
    Code:
    error 100: function prototypes do not match
    example code:
    Code:
    #include <sourcemod>
    
    #pragma    semicolon 1
    #pragma newdecls required
    
    public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
    {
         CreateNative("TestNative", _TestNative);
         return APLRes_Success;
    }
    
    public bool _TestNative(Handle plugin, int numParams)
    {
        return GetSpawnAccess();  
    }
    
    bool GetSpawnAccess()
    {
       return true;
    }
For now, you must just retag the return value. return view_as<int>(true);

Note that this is nothing new, other than the transitional syntax for retagging. Before, it would have been return _:true; (which is still valid now).

Quote:
Originally Posted by Electr000999 View Post
  • line public void OnEntityCreated(int entity, const char[] classname) get error:
    Code:
    error 180: function return type differs from prototype. expected 'int', but got 'void'
    example code:
    Code:
    #include <sourcemod>
    #include <sdkhooks>
    
    #pragma    semicolon 1
    #pragma newdecls required
    
    public void OnEntityCreated(int entity, const char[] classname)
    {
        if (IsServerProcessing())
        {                
            
        }
    }
    in sdkhooks.inc
    Code:
    /**
     * @brief When an entity is created
     *
     * @param        entity        Entity index
     * @param        classname    Class name
     */
    forward void OnEntityCreated(int entity, const char[] classname);
I think that you are compiling against old include files.

Last edited by psychonic; 04-20-2015 at 07:30.
psychonic is offline
Electr000999
Senior Member
Join Date: Aug 2011
Old 04-20-2015 , 08:28   Re: SourceMod 1.7.1 Released
#12

okay, what about the second problem? i am download latest release from main page, and check this .inc on official repository github.com/alliedmodders, all this crap.
Attached Thumbnails
Click image for larger version

Name:	44.PNG
Views:	992
Size:	19.1 KB
ID:	144405  

Last edited by Electr000999; 04-20-2015 at 08:43.
Electr000999 is offline
Send a message via Skype™ to Electr000999
psychonic

BAFFLED
Join Date: May 2008
Old 04-20-2015 , 09:26   Re: SourceMod 1.7.1 Released
#13

Quote:
Originally Posted by Electr000999 View Post
okay, what about the second problem? i am download latest release from main page, and check this .inc on official repository github.com/alliedmodders, all this crap.
This was supposed to be in 1.7.1, and is even noted on the changelog, but was missed.
https://github.com/alliedmodders/sourcemod/pull/294

I will respin the release package today.

Edit: that commit was in. A similar change for just sdkhooks.inc got missed as only part of the commit was meant for 1.7.1.

Edit 2: I've just made a link to the updated file on the current release's download page.

Last edited by psychonic; 04-20-2015 at 13:25.
psychonic is offline
Electr000999
Senior Member
Join Date: Aug 2011
Old 04-21-2015 , 03:55   Re: SourceMod 1.7.1 Released
#14

Quote:
Originally Posted by psychonic View Post
This was supposed to be in 1.7.1, and is even noted on the changelog, but was missed.
https://github.com/alliedmodders/sourcemod/pull/294

I will respin the release package today.

Edit: that commit was in. A similar change for just sdkhooks.inc got missed as only part of the commit was meant for 1.7.1.

Edit 2: I've just made a link to the updated file on the current release's download page.
thx), works fine.

Last edited by Electr000999; 04-21-2015 at 03:56.
Electr000999 is offline
Send a message via Skype™ to Electr000999
Electr000999
Senior Member
Join Date: Aug 2011
Old 04-21-2015 , 11:07   Re: SourceMod 1.7.1 Released
#15

I am found bug in checks with new view_as.. and enum i writed example for repeating mistakes.., or it features new syntax?

Code:
#include <sourcemod>

#pragma	semicolon 1
#pragma newdecls required

enum TestType
{
	TYPE_ONE = 1,	TYPE_TWO,		TYPE_THREE
}

public void OnPluginStart()
{
	RegConsoleCmd ( "sm_test"					, CmdTest, "");
}

public Action CmdTest(int client, int args)
{
	int iVar = 3;
	
	// WORKS CORRECT
	if(iVar != 3)
	{
		PrintToChatAll("[test 1] %i != 3", iVar);
	}
	else
	{
		PrintToChatAll("[test 1] %i == 3", iVar);
	}
	
	// WORKS CORRECT
	if(!(iVar == 2 || iVar == 3))
	{
		PrintToChatAll("[test 2] %i != 2 or 3", iVar);
	}
	
	// OLD variant view_as work fine
	if(!(iVar == _:TYPE_TWO || iVar == _:TYPE_THREE))
	{
		PrintToChatAll("[test 3] %i != %i or %i", iVar, TYPE_TWO, TYPE_THREE);
	}
	
	// BROKEN
	if(!(iVar == view_as<int>TYPE_TWO || iVar == view_as<int>TYPE_THREE))
	{
		PrintToChatAll("[test 4] %i != %i or %i - !BUG!", iVar, TYPE_TWO, TYPE_THREE);
	}
	
	// WORKS CORRECT if i am place check in ()
	if(!((iVar == view_as<int>TYPE_TWO) || (iVar == view_as<int>TYPE_THREE)))
	{
		PrintToChatAll("[test 5] %i != %i or %i", iVar, TYPE_TWO, TYPE_THREE);
	}
}
Attached Files
File Type: sp Get Plugin or Get Source (test_checks.sp - 996 views - 1.1 KB)

Last edited by Electr000999; 04-21-2015 at 11:16.
Electr000999 is offline
Send a message via Skype™ to Electr000999
cam0
Senior Member
Join Date: Feb 2015
Old 04-21-2015 , 23:29   Re: SourceMod 1.7.1 Released
#16

I get warnings compiling on 1.7+ (didn't occur prior)
Code:
new g_ModeConfig[MAX_MODES][ModeConfig]; public OnPluginStart(){ CreateNative("Mode_GetConfig", Native_GetModeConfig); } public Native_GetModeConfig(Handle:plugin, numParams) {     new Mode = GetNativeCell(1);         if(Mode < g_TotalModes)     {         SetNativeArray(2, g_ModeConfig[Mode], ModeConfig);          return true;     }     else     {         return false;     } }

In my .inc
Code:
enum ModeConfig {     String:Name[32],     String:Name_Short[32],     bool:Enabled,     bool:TempEnabled,     Testvalue }; native Mode_GetConfig(Mode, Properties[]);


The error I get is with SetNativeArray(2, g_ModeConfig[Mode], ModeConfig); The second argument is the error (g_ModeConfig[Mode]).

cam0 is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 04-23-2015 , 05:14   Re: SourceMod 1.7.1 Released
#17

If I recompile plugins in 171. Can I place them on 170 servers or should all servers run 171 also?
__________________
Neuro Toxin is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 04-23-2015 , 06:32   Re: SourceMod 1.7.1 Released
#18

Quote:
Originally Posted by Neuro Toxin View Post
If I recompile plugins in 171. Can I place them on 170 servers or should all servers run 171 also?
No, it's fine to run a plugin compiled with 1.7.1 on 1.7.0. If you do have any issues, just use the 1.7.0 include files with the 1.7.1 compiler.
__________________
asherkin is offline
Kriax
Senior Member
Join Date: Apr 2012
Old 04-23-2015 , 07:44   Re: SourceMod 1.7.1 Released
#19

It is still impossible to compile the old syntax with the new compiler?
I did not want to change everything .. it's a lot of work ...
Kriax is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 04-23-2015 , 07:47   Re: SourceMod 1.7.1 Released
#20

Quote:
Originally Posted by Kriax View Post
It is still impossible to compile the old syntax with the new compiler?
It's never been impossible, see the 1.7.0 release post for information about the very few breaking changes.
__________________
asherkin is offline
Closed Thread


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 22:56.


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