SA-MP Forums Archive
Error is Trolling with me or what? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Error is Trolling with me or what? (/showthread.php?tid=625726)



Error is Trolling with me or what? - RyderX - 05.01.2017

Hey Guys, so i've been making Admin System, And Finished a Part, and got 1 Error:

Код:
C:\Users\Admin\Desktop\[GameMode]World Stunt Freeroam v0.5\filterscripts\RAdmin.pwn(148) : error 001: expected token: ")", but found "return"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
And here's the code where the error is:

PHP код:
CMD:promote(playerid,params[])
{
    new 
id,level;
    if(
IsPlayerAdmin(playerid)) 
    {
148>>     if(sscanf(params,"ud",id,level) return SendClientMessage(playerid0xF8F8F8FFF,"[SERVER]: {FFFFFF}/promote [ID] [Level].");
        else
        {
            if(
level 5) return SendClientMessage(playerid0xF8F8F8FFF"[SERVER]: {FFFFFF}highest Level is 5.");
            else
            {
                new 
INI:File INI_Open(UserPath(id));
                
INI_WriteInt(File,"Admin",level);
                
INI_Close(File);
            }
        }
    }
    else
    {
        
SendClientMessage(playerid0xf8F8F8FFF,"[SERVER]: {FFFFFF}You are not RCON Admin to Access to This Command!");
    }
    return 
1;

i have tried a lot to fix and ain't fixing please help!


Re: Error is Trolling with me or what? - GoldenLion - 05.01.2017

Код:
if(sscanf(params,"ud",id,level) return SendClientMessage(playerid, 0xF8F8F8FFF,"[SERVER]: {FFFFFF}/promote [ID] [Level].");
You forgot a bracket.
Код:
if(sscanf(params,"ud",id,level)) return SendClientMessage(playerid, 0xF8F8F8FFF,"[SERVER]: {FFFFFF}/promote [ID] [Level].");
EDIT: Vince has a better answer below.


Re: Error is Trolling with me or what? - Vince - 05.01.2017

Код:
if(sscanf(params,"ud",id,level) return
          ^____________________^
  ^_____________________________^ ?
It's really not that hard.


Re: Error is Trolling with me or what? - iLearner - 05.01.2017

Quote:

if(sscanf(params,"ud",id,level))
Bold text.


Re: Error is Trolling with me or what? - RyderX - 05.01.2017

Lmao, Thanks didn't Noticed... Thanks GoldenLion + Vince!

Edit: And iLearner.