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

error 001: expected token: "(", but found "{"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SpirT
Senior Member
Join Date: Sep 2018
Location: Portugal
Old 05-27-2020 , 14:22   error 001: expected token: "(", but found "{"
Reply With Quote #1

Hey

I have got the error on this:
PHP Code:
view_as<float>{0.0,0.0,0.0}; 
Tried this but plugin does not work:
PHP Code:
view_as<float>( { 0.00.00.0 } ); 
Any fix?
__________________
SpirT is offline
Kellan123
AlliedModders Donor
Join Date: Aug 2012
Old 05-27-2020 , 14:37   Re: error 001: expected token: "(", but found "{"
Reply With Quote #2

What about this works fine with latest compile.

New Snytax:
PHP Code:
#include < sourcemod >

#pragma semicolon 1
#pragma newdecls required

public void OnPluginStart( )
{
    
float fTest];
    
fTest view_as<float>( { 0.00.00.0 } );
    
    
PrintToServer"%.1f, %.1f, %.1f"fTest], fTest], fTest] );

// Edit: this one works too

Old:
PHP Code:
float fTest] = { 0.00.00.0 }; 

Last edited by Kellan123; 05-30-2020 at 06:41. Reason: Tilex
Kellan123 is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 05-27-2020 , 23:46   Re: error 001: expected token: "(", but found "{"
Reply With Quote #3

On 1.11, you don't need to use view_as in cases like this to avoid a tag mismatch warning.
Fyren is offline
SpirT
Senior Member
Join Date: Sep 2018
Location: Portugal
Old 05-28-2020 , 05:00   Re: error 001: expected token: "(", but found "{"
Reply With Quote #4

Quote:
Originally Posted by Fyren View Post
On 1.11, you don't need to use view_as in cases like this to avoid a tag mismatch warning.
Btw, I am trying to compile DR API AFK Manager v. 1.0.1 because I want to change that chat TAG. When I compile if I use both ways, one gives error, other not, and the ones that compile does not do anything.

Is there any way to make it work?
__________________
SpirT is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 05-28-2020 , 15:54   Re: error 001: expected token: "(", but found "{"
Reply With Quote #5

Which version of the compiler are you using? Can you give us an actual example of what you're doing?
Fyren is offline
Tilex
Junior Member
Join Date: May 2020
Old 05-29-2020 , 20:17   Re: error 001: expected token: "(", but found "{"
Reply With Quote #6

why not simply
PHP Code:
float fTest] = { 0.00.00.0 }; 
or
PHP Code:
float fTest[3];
fTest[0] = 0.0;
fTest[1] = 0.0;
fTest[2] = 0.0
Tilex is offline
SpirT
Senior Member
Join Date: Sep 2018
Location: Portugal
Old 06-06-2020 , 10:49   Re: error 001: expected token: "(", but found "{"
Reply With Quote #7

Quote:
Originally Posted by Fyren View Post
Which version of the compiler are you using? Can you give us an actual example of what you're doing?
Hey! As I said before I am trying to change the chat tag of the DR API AFK MANAGER (v. 1.0.1). I am using SPEdit with the includes of the sourcemod version 1.10.0.6482.
__________________
SpirT 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 05:43.


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