AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Error: expected token: ";" but found "-identifier-" (https://forums.alliedmods.net/showthread.php?t=172856)

quilhos 11-26-2011 16:11

Error: expected token: ";" but found "-identifier-"
 
Well I have a small problem in compilation:

PHP Code:

MakeTutor(id,Text[],Color,Float:Time 0.0
{
    
    
message_begin(MSG_ALL,g_MsgTutor,_,id);
    
write_string(Text);
    
write_byte(0);
    
write_short(0);
    
write_short(0);
    
write_short(1<<Color);
    
message_end();
    
    if(
Time != 0.0)
    {
        
        
set_task(Time,"RemoveTutor",id TASK_TUT);
    }
}

MsgWelcome(id,Text[],Color,Float:Time 0.0
{
    
    
message_begin(MSG_ONE_UNRELIABLE,g_MsgTutor,_,id);
    
write_string(Text);
    
write_byte(0);
    
write_short(0);
    
write_short(0);
    
write_short(1<<Color);
    
message_end();
    
    if(
Time != 0.0)
    {
        
set_task(Time,"RemoveTutor",id TASK_TUT);
    }
}

public 
RemoveTutor(taskID)
{
    
    new 
id taskID TASK_TUT
    
    
    message_begin
(MSG_ALL,g_MsgTutClose,_,id);
    
message_end();


Thanks for help :D

jim_yang 11-26-2011 16:26

Re: Error: expected token: ";" but found "-identifier-"
 
you missed a ";"
learn to debug compiling errors next time.
it always show you which line the error occurred.

quilhos 11-26-2011 16:45

Re: Error: expected token: ";" but found "-identifier-"
 
Please show me where is my error post the code in the correctly form

Impact123 11-26-2011 17:02

Re: Error: expected token: ";" but found "-identifier-"
 
PHP Code:

new id taskID TASK_TUT 

Goes to
PHP Code:

new id taskID TASK_TUT

Yours sincerely
Impact

quilhos 11-26-2011 17:21

Re: Error: expected token: ";" but found "-identifier-"
 
new id = taskID - TASK_TUT;

thanks, but found other problem, expected token: ";" but found "-identifier-", but in another line

lucas_7_94 11-26-2011 17:43

Re: Error: expected token: ";" but found "-identifier-"
 
what line ?

Hunter-Digital 11-26-2011 18:10

Re: Error: expected token: ";" but found "-identifier-"
 
Quote:

Originally Posted by quilhos (Post 1603251)
new id = taskID - TASK_TUT;

thanks, but found other problem, expected token: ";" but found "-identifier-", but in another line

It's the exact same problem, is it that hard to replicate the fix, adding ; on the end of that line ?

But still, amxx compile doesn't require a ; by default, you have a #pragma semicolon (or something) in your code that requires it, just remove that and you don't have to worry about ; anymore.

quilhos 11-26-2011 18:15

Re: Error: expected token: ";" but found "-identifier-"
 
At the beginning gave me two errors equal (Error: expected token: ";" but found "-identifier-"), but one is solved, but the other still remains.

Solved:
PHP Code:

 new id taskId TASK_TUT


I don't know what's the other problem


All times are GMT -4. The time now is 08:24.

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