Error 001: Expected token: ";" but found "return"
#1

Sup guys,
I got a problem,
If I compile my gamemode it shows up this error:
Код:
C:\Users\Gebruiker\Documents\GTA San Andreas\samp servers\Fast Hustler Roleplay V4.0\gamemodes\EXRPR48.pwn(31735) : error 001: expected token: ";", but found "return"
Here's the part where the error is:
Код:
CMD:destroyallflares(playerid, params[])
{
	if(!IsACop(playerid))
 	{
  		return SendClientMessage(playerid,COLOR_GREY,"   You cannot use this command !");
    }
    if(IsACop(playerid))
    {
    	if(PlayerInfo[playerid][pRank] < 6)
	    {
     		return SendClientMessage(playerid,COLOR_GREY,"   Your rank is too low to be removing flares !");
	    	}
		}
		else
		{
  		if(PlayerInfo[playerid][pRank] < 5)
    	{
      		return SendClientMessage(playerid,COLOR_GREY,"   Your rank is too low to be removing flares !");
  		}
	}
	DeleteAllFlare()
  	return 1; //THIS LINE
}
Here's where the Deleteallflare function is defined:
Код:
stock DeleteAllFlare()
{
    for(new i = 0; i < sizeof(FlareInfo); i++)
  	{
  	    if(FlareInfo[i][fCreated] == 1)
  	    {
  	        FlareInfo[i][fCreated]=0;
            FlareInfo[i][fX]=0.0;
            FlareInfo[i][fY]=0.0;
            FlareInfo[i][fZ]=0.0;
            DestroyObject(FlareInfo[i][fObject]);
  	    }
	}
    return 0;
}
I still don't got a scripter for my RP server, so I do it by myself, but as this doesn't work, I asked for help


Greets,
Bradleyornot
Reply
#2

So, try:

CMD:destroyallflares(playerid, params[])
{
if(!IsACop(playerid))
{
return SendClientMessage(playerid,COLOR_GREY," You cannot use this command !");
}
if(IsACop(playerid))
{
if(PlayerInfo[playerid][pRank] < 6)
{
return SendClientMessage(playerid,COLOR_GREY," Your rank is too low to be removing flares !");
}
}
else
{
if(PlayerInfo[playerid][pRank] < 5)
{
return SendClientMessage(playerid,COLOR_GREY," Your rank is too low to be removing flares !");
}
}
DeleteAllFlare();
return 1; //THIS LINE
}

should solve your problem
Reply
#3

Wow.... So stupid, I forgot the ; behind the Deleteallflare function, *Facepalm*
Thanks mate
Reply
#4

Happens friend, success in your gamemode haha
Reply
#5

Thanks :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)