Help , samp error 014: invalid statement; not in switch
#3

oops no this, change case 1: to

Код:
case 1:
{
	if(playerVariables[playerid][pCarID1] >= 1)
 	{
  		if (HelperTokens[ playerid ] < 50)
  		{
    		SendClientMessage(playerid, COLOR_GRAD2, "You need 50 helper/admin tokens for this action.");
      		return 1;
        }
        HelperTokens[ playerid ] -= 50;
        playerVariables[playerid][pCarKM] = 0;
        format(string,sizeof(string),"UPDATE playeraccounts SET playerCarTrunk1 = '0' WHERE playerID = '%d'",playerVariables[playerid][pInternalID]);
        mysql_query(string);
        SendClientMessage(playerid, COLOR_GRAD2, "You succesfull clear your car 1 kilometers! (-50 helper/admin tokens).");
    }
}
forgotten last }


Fixed code:

Код:
case 3333:
{
	if(response)
 	{
  		new string[256];
    	switch(listitem)
     	{
      		case 0:
        	{
         		if(playerVariables[playerid][pWarns] <= 0) //
                return SendClientMessage(playerid, COLOR_GRAD2, "You don't have any warn.");
                if( HelperTokens[ playerid ] < 30)
                return SendClientMessage(playerid, COLOR_GRAD2, "You need 30 helper/admin tokens for this action.");
                new wakaname[25];
                GetPlayerName(playerid,wakaname,25);
                new str[128];
                format(str,128,"UPDATE `playeraccounts` SET `playerVIP`='0' WHERE `playerName`='%s'",wakaname);
                mysql_query(str);
                HelperTokens[ playerid ] -= 30;
                playerVariables[playerid][pWarns] = 0;
                SendClientMessage(playerid, COLOR_WHITE, "(!) You have cleared your warns!(-30 -30 helper/admin tokens)"); // dupa ce ii se sterge 1 warn, ii apare acest mesaj.
           }
           case 1:
           {
       			if(playerVariables[playerid][pCarID1] >= 1)
            	{
            		if (HelperTokens[ playerid ] < 50)
             		{
              			SendClientMessage(playerid, COLOR_GRAD2, "You need 50 helper/admin tokens for this action.");
                		return 1;
                	}
                	HelperTokens[ playerid ] -= 50;
                	playerVariables[playerid][pCarKM] = 0;
                	format(string,sizeof(string),"UPDATE playeraccounts SET playerCarTrunk1 = '0' WHERE playerID = '%d'",playerVariables[playerid][pInternalID]);
                	mysql_query(string);
                	SendClientMessage(playerid, COLOR_GRAD2, "You succesfull clear your car 1 kilometers! (-50 helper/admin tokens).");
   				}
			}
      		case 2: // the line with the error
        	{
         		if(playerVariables[playerid][pCarID2] >= 1)
                {
                	if (HelperTokens[ playerid ] < 50) // Aici verifica daca playerul are 0 warns, daca acesta are 0 warn i se va trimite un mesaj cu "Nu ai niciun warn." cel de mai jos.
                    {
                    	SendClientMessage(playerid, COLOR_GRAD2, "You need 50 helper/admin tokens for this action.");
                        return 1;
                 	}
                  	HelperTokens[ playerid ] -= 50;
                   	playerVariables[playerid][pCarKM2] = 0;
                    format(string,sizeof(string),"UPDATE playeraccounts SET playerCarKM2 = '0' WHERE playerID = '%d'",playerVariables[playerid][pInternalID]);
                    mysql_query(string);
                    SendClientMessage(playerid, COLOR_GRAD2, "You succesfull clear your car 2 kilometers! (-50 helper/admin tokens).");
                }
           	}
        }
   	}
}
Reply


Messages In This Thread
Help , samp error 014: invalid statement; not in switch - by buburuzu19 - 05.09.2014, 06:33
Re: Help , samp error 014: invalid statement; not in switch - by TheNerka - 05.09.2014, 06:39
Re: Help , samp error 014: invalid statement; not in switch - by TheNerka - 05.09.2014, 06:42
Re: Help , samp error 014: invalid statement; not in switch - by buburuzu19 - 05.09.2014, 07:04

Forum Jump:


Users browsing this thread: 1 Guest(s)