SA-MP Forums Archive
Error "}" - 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 "}" (/showthread.php?tid=539011)



Error "}" - Jigsaw123 - 25.09.2014

Hello guys..
I have gotten this error that I need help with

These are the errors:
Код:
C:\Users\USER\Desktop\War\gamemodes\WW-RP.pwn(3667) : error 010: invalid function or declaration
C:\Users\USER\Desktop\War\gamemodes\WW-RP.pwn(3672) : error 054: unmatched closing brace ("}")
C:\Users\USER\Desktop\War\gamemodes\WW-RP.pwn(3677) : error 010: invalid function or declaration
Lines 3667 - 3677
Код:
    if(PlayerInfo[playerid][pLoggedIn] && PlayerInfo[playerid][pSpawn])
    {
        FalseBan[playerid] = 0;
        SetTimerEx("FalseBanFix", 6000, false, "i", playerid);
    	SpawnChar(playerid);
	}
   	GameTextForPlayer(playerid, "~w~Character Loading...", 3500, 3);
	TogglePlayerControllable(playerid, 0);
	SetPlayerVirtualWorld(playerid, 0);
	SetTimerEx("EnterExitTimer", 5000, false, "i", playerid);
	return 1;
}
Thank you!


Re: Error "}" - Beckett - 25.09.2014

Isn't it obvious?

pawn Код:
if(PlayerInfo[playerid][pLoggedIn] && PlayerInfo[playerid][pSpawn])
    {
        FalseBan[playerid] = 0;
        SetTimerEx("FalseBanFix", 6000, false, "i", playerid);
        SpawnChar(playerid);
    GameTextForPlayer(playerid, "~w~Character Loading...", 3500, 3);
    TogglePlayerControllable(playerid, 0);
    SetPlayerVirtualWorld(playerid, 0);
    SetTimerEx("EnterExitTimer", 5000, false, "i", playerid);
    return 1;
}



Re: Error "}" - Ghazal - 25.09.2014

It is because of the } Which you wrote in the code without any need.
pawn Код:
if(PlayerInfo[playerid][pLoggedIn] && PlayerInfo[playerid][pSpawn])
    {
        FalseBan[playerid] = 0;
        SetTimerEx("FalseBanFix", 6000, false, "i", playerid);
        SpawnChar(playerid);
    GameTextForPlayer(playerid, "~w~Character Loading...", 3500, 3);
    TogglePlayerControllable(playerid, 0);
    SetPlayerVirtualWorld(playerid, 0);
    SetTimerEx("EnterExitTimer", 5000, false, "i", playerid);
      }
    return 1;
}



Re: Error "}" - Jigsaw123 - 25.09.2014

C:\Users\USER\Desktop\War\gamemodes\WW-RP.pwn(3656) : error 010: invalid function or declaration
C:\Users\USER\Desktop\War\gamemodes\WW-RP.pwn(3661) : error 021: symbol already defined: "GameTextForPlayer"
C:\Users\USER\Desktop\War\gamemodes\WW-RP.pwn(3665) : error 010: invalid function or declaration


Re: Error "}" - Ghazal - 25.09.2014

Quote:
Originally Posted by Jigsaw123
Посмотреть сообщение
C:\Users\USER\Desktop\War\gamemodes\WW-RP.pwn(3656) : error 010: invalid function or declaration
C:\Users\USER\Desktop\War\gamemodes\WW-RP.pwn(3661) : error 021: symbol already defined: "GameTextForPlayer"
C:\Users\USER\Desktop\War\gamemodes\WW-RP.pwn(3665) : error 010: invalid function or declaration
Can you show us each line 3656, line 3661, line 3665, every line please type a comment beside it with the number for example // line 3656 So we can understand.


Re: Error "}" - Jigsaw123 - 25.09.2014

CODE:
C:\Users\USER\Desktop\War\gamemodes\WW-RP.pwn(3634) : error 010: invalid function or declaration
C:\Users\USER\Desktop\War\gamemodes\WW-RP.pwn(3639) : error 021: symbol already defined: "GameTextForPlayer"
C:\Users\USER\Desktop\War\gamemodes\WW-RP.pwn(3643) : error 010: invalid function or declaration

Lines 3634 - 3644:
if(PlayerInfo[playerid][pLoggedIn] && PlayerInfo[playerid][pSpawn]) // Line 3634
{
FalseBan[playerid] = 0;
SetTimerEx("FalseBanFix", 6000, false, "i", playerid);
SpawnChar(playerid);
GameTextForPlayer(playerid, "~w~Character Loading...", 3500, 3); // Line 3639
TogglePlayerControllable(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetTimerEx("EnterExitTimer", 5000, false, "i", playerid);
return 1; // Lines 3643
}


Re: Error "}" - Ghazal - 25.09.2014

pawn Код:
if(PlayerInfo[playerid][pLoggedIn] == 1 && PlayerInfo[playerid][pSpawn] == 1) // Line 3634
{
FalseBan[playerid] = 0;
SetTimerEx("FalseBanFix", 6000, false, "i", playerid);
SpawnChar(playerid);
GameTextForPlayer(playerid, "~w~Character Loading...", 3500, 3); // Line 3639
TogglePlayerControllable(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetTimerEx("EnterExitTimer", 5000, false, "i", playerid);
}
return 1; // Lines 3643
}



Re: Error "}" - Jigsaw123 - 25.09.2014

I still get the same error..


Re: Error "}" - Goldac - 25.09.2014

Код:
public OnPlayerConnect(playerid)
{
       if(PlayerInfo[playerid][pLoggedIn] && PlayerInfo[playerid][pSpawn])
             {
                       FalseBan[playerid] = 0;
                       SetTimerEx("FalseBanFix", 6000, false, "i", playerid);
    	               SpawnChar(playerid);
                       GameTextForPlayer(playerid, "~w~Character Loading...", 3500, 3);
	               TogglePlayerControllable(playerid, 0);
	               SetPlayerVirtualWorld(playerid, 0);
	               SetTimerEx("EnterExitTimer", 5000, false, "i", playerid);
             }
             return 1;
}
its will be something like that probably