Raised This Month: $51 Target: $400
 12% 

New API and Syntax


Post New Thread Reply   
 
Thread Tools Display Modes
nergal
Veteran Member
Join Date: Apr 2012
Old 03-25-2016 , 18:51   Re: New API and Syntax
Reply With Quote #711

Quote:
Originally Posted by BAILOPAN View Post
That doesn't really change how it would be implemented. The best we could do is some kind of hook in the typename parser that has a table of alternate tokens to return. That might be an option, actually, but I'll have to think about it.
it's 1000x better than the #defines I'd be using...

PHP Code:
#define vec3(%1)          float %1[3] 
__________________

Last edited by nergal; 03-25-2016 at 18:51.
nergal is offline
xerox8521
Senior Member
Join Date: Sep 2011
Old 03-26-2016 , 15:45   Re: New API and Syntax
Reply With Quote #712

Would it be maybe possible for sourcemod in general to make commands case insensitive? It can default to false so it wont break any plugins. like RegConsoleCmd("sm_test",Command_Test,"Test",t rue); respectivly for RegAdminCmd and RegServerCmd
xerox8521 is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 03-27-2016 , 15:24   WTF?! O_o
Reply With Quote #713

why I see errors
Code:
//SourceMod Batch Compiler
// by the SourceMod Dev Team

//// some_plugin.sp
//
// ...\addons\sourcemod\scripting\some_plugin.sp (83) : error 105: cannot find method or property Handle.GetItem
// ...\addons\sourcemod\scripting\some_plugin.sp (83) : error 092: number of arguments does not match definition
//
// 2 Errors.
//
// Compilation Time: 0,23 sec
if try compile plugin with this strings:
PHP Code:
#pragma newdecls required

...

public 
int Some_Handler(Handle menuMenuAction actionint clientint param)
{
if (
action == MenuAction_Select)
{
char info[18];
menu.GetItem(paraminfosizeof(info));
...
}

Code:
SourceMod Version Information:
SourceMod Version: 1.8.0.5845
SourcePawn Engine: SourcePawn 1.8, jit-x86 (build 1.8.0.5845)
SourcePawn API: v1 = 4, v2 = 11
Compiled on: Feb 3 2016 15:33:24
Built from: https://github.com/alliedmodders/sourcemod/commit/b9e9e15
Build ID: 5845:b9e9e15
http://www.sourcemod.net/
in SM v1.8 syntax differs from v1.7?
__________________

Last edited by asherkin; 03-30-2016 at 04:22. Reason: Don't blank out posts.
Grey83 is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 03-27-2016 , 17:12   Re: New API and Syntax
Reply With Quote #714

Like the message says, Handle has no such method, Menu does.
PHP Code:
public int Some_Handler(Handle menuMenuAction actionint clientint param
should be
PHP Code:
public int Some_Handler(Menu menuMenuAction actionint clientint param
__________________

Last edited by Impact123; 03-27-2016 at 17:26.
Impact123 is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 03-27-2016 , 17:28  
Reply With Quote #715

Quote:
Originally Posted by Impact123 View Post
should be
PHP Code:
public int Some_Handler(Menu menuMenuAction actionint clientint param
Thanks, didn't notice
__________________
Grey83 is offline
Merudo
Senior Member
Join Date: Feb 2016
Old 04-02-2016 , 11:40   Re: New API and Syntax
Reply With Quote #716

Is the new syntax supported by NP++ Syntax Highlighting plugins?
__________________
Merudo is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 04-02-2016 , 12:26   Re: New API and Syntax
Reply With Quote #717

Quote:
Originally Posted by Merudo View Post
Is the new syntax supported by NP++ Syntax Highlighting plugins?
https://forums.alliedmods.net/forumdisplay.php?f=112 - Third from the top
__________________
Plugins: TeamGames
Includes: Menu stocks, ColorVariables, DownloadTableConfig

> No help through PM, make a topic.
KissLick is offline
You9
Member
Join Date: Mar 2016
Old 04-03-2016 , 02:53   Re: New API and Syntax
Reply With Quote #718

Code:
KillTimer(timer9);
timer9 = null;
translate to this? -->

Code:
delete timer9;
You9 is offline
IceCucumber
Member
Join Date: Dec 2011
Old 04-04-2016 , 14:48   Re: New API and Syntax
Reply With Quote #719

Hi, quick question about this new syntax.

How does this convert? Is there such a thing as const char?

PHP Code:
new const String:foo[] = "bar"
I tried:
PHP Code:
const char foo "bar"
But it gives me a
Quote:
error 008: must be a constant expression; assumed zero
IceCucumber is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 04-04-2016 , 16:12   Re: New API and Syntax
Reply With Quote #720

it's:
PHP Code:
 const char foo[] = "bar"

Last edited by WildCard65; 04-04-2016 at 16:12.
WildCard65 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 21:08.


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