Errors
#1

I copied this code from another mode:
PHP код:
    for(new i=0;i<MAX_PLAYERS;i++)
    {
    switch(
reason)
    {
    case 
0; {
    
format(Stringsizeof(String), "%s has left the server. (Crash)"playername);
    
SendClientMessage(i,COLOR_JGREYString); }
    case 
1; {
    
format(Stringsizeof(String), "%s has left the server. (Leaving)"playername);
    
SendClientMessage(i,COLOR_JGREYString); }
    case 
2; {
    
format(Stringsizeof(String), "%s has left the server. (Kicked/Banned)"playername);
    
SendClientMessage(i,COLOR_JGREYString); }
    } } 
But when I put it on my server,I get those errors:
PHP код:
C:\Documents and Settings\XXX\XXX\XXX\XXX\XXX.pwn(984) : error 001expected token":"but found ";"
C:\Documents and Settings\XXX\XXX\XXX\XXX\XXX.pwn(984) : error 036: empty statement
C
:\Documents and Settings\XXX\XXX\XXX\XXX\XXX.pwn(987) : error 014invalid statementnot in switch
C:\Documents and Settings\XXX\XXX\XXX\XXX\XXX.pwn(987) : warning 215expression has no effect
C
:\Documents and Settings\XXX\XXX\XXX\XXX\XXX.pwn(989) : error 017undefined symbol "i"
C:\Documents and Settings\XXX\XXX\XXX\XXX\XXX.pwn(990) : error 014invalid statementnot in switch
C:\Documents and Settings\XXX\XXX\XXX\XXX\XXX.pwn(990) : warning 215expression has no effect
C
:\Documents and Settings\XXX\XXX\XXX\XXX\XXX.pwn(992) : error 017undefined symbol "i"
C:\Documents and Settings\XXX\XXX\XXX\XXX\XXX.pwn(993) : error 054unmatched closing brace ("}")
C:\Documents and Settings\XXX\XXX\XXX\XXX\XXX.pwn(995) : error 010invalid function or declaration 
What is wrong?
Reply
#2

It's case 0: - not case 0;

The first error couldnt be any clearer tbh.
Reply
#3

Quote:
Originally Posted by BMUK
Посмотреть сообщение
It's case 0: - not case 0;

The first error couldnt be any clearer tbh.
Oops :P
I haven't noticed that,I changed everything to : and all the errors are gone
tyvm
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)