double errors
#1

I tried to do the command/ticket on the dialog. I mean ID and/ticket occur there fines but gives me error.
(2588 : warning 209: function "cmd_ticket" should return a value
(2588 : error 075: input line too long (after substitutions)
(25891) : error 010: invalid function or declaration

25888
}

26891
}

All commands
Код:
CMD:ticket(playerid, params[])
{
	new amendat, giveplayerid, string[256], sendername[MAX_PLAYER_NAME], giveplayer, moneys, result;
        if(sscanf(params, "u", amendat)) return SendClientMessage(playerid, COLOR_GRAD2, "{00FF00}Folosire:{FFFFFF} /ticket[PlayerID/PartOfName]");
	    if(IsPlayerConnected(playerid))
	    {
            	if(!IsACop(playerid))
			{
			    SendClientMessage(playerid, COLOR_GREY, "   Nu esti politist!");
			    return 1;
			}
	        if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)
			{
			    SendClientMessage(playerid, COLOR_GREY, "   Nu esti la datorie!");
			    return 1;
			}
			if(IsPlayerConnected(giveplayerid))
			{
			    if(giveplayerid != INVALID_PLAYER_ID)
			    {
						if(PlayerInfo[giveplayerid][pLevel] < 2) return SendClientMessage(playerid, COLOR_WHITE, "{0066FF}Ticket: {FFFFFF}Nu poti da amenda jucatorilor cu level 1!");
						format(string, sizeof(string), "* You gave %s a Ticket costing $%d, reason: %s", giveplayer, moneys, (result));
						SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
						format(string, sizeof(string), "* Offiterul %s ti-a dat o amenda in valoare de $%d, motiv: %s", sendername, moneys, (result));
						SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
						SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, "* Scrie /accept ticket, pentru a plati amenda.");
						TicketOffer[giveplayerid] = playerid;
						TicketMoney[giveplayerid] = moneys;
						return 1;
					}
					else
					{
						SendClientMessage(playerid, COLOR_GREY, "   Acel jucator nu este langa tine !");
						return 1;
					}
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "   Acel jucator este offline !");
			    return 1;
			}
		}
		ShowPlayerDialog(917, DIALOG_AMENDA, DIALOG_STYLE_LIST, "Selecteaza amenda:", "1. Folosire telefon la volan -> 5.000$ amenda\n2. Condus fara centura -> 10.000$ amenda\3. Oprire/Stationare/Parcare Neregulamentara -> 10.000$ amenda\n4. Condus neregulamentar (contra-sens, etc.) -> Suspendarea permisului + 25.000$ amenda\n5. Conducerea vehiculelor cu roti sparte -> 10.000$ amenda\n6. Folosire NOS -> Suspendarea permisului + 10.000$ amenda\n7. Folosire Hidraulice -> Suspendarea permisului + 10.000$ amenda\n8. Faruri stinse (headlights off) (pe timpul noptii, dupa ora 21:00) -> 10.000$ amenda\n9. Condus sub influenta alcoolului -> Suspendarea permisului + 20.000$ amenda\n10. Depasirea limitei de viteza cu:\n-> 10 - 50 km/h ->  10.000$ amenda\n-> 50+ km/h      -> Suspendarea permisului de conducere + 20.000$", "Select", "Close");
		return 1;
	}
Reply
#2

Quote:
Originally Posted by Jimmi
Посмотреть сообщение
I tried to do the command/ticket on the dialog. I mean ID and/ticket occur there fines but gives me error.
(2588 : warning 209: function "cmd_ticket" should return a value
(2588 : error 075: input line too long (after substitutions)
(25891) : error 010: invalid function or declaration

25888
}

26891
}

All commands
Код:
CMD:ticket(playerid, params[])
{
	new amendat, giveplayerid, string[256], sendername[MAX_PLAYER_NAME], giveplayer, moneys, result;
        if(sscanf(params, "u", amendat)) return SendClientMessage(playerid, COLOR_GRAD2, "{00FF00}Folosire:{FFFFFF} /ticket[PlayerID/PartOfName]");
	    if(IsPlayerConnected(playerid))
	    {
            	if(!IsACop(playerid))
			{
			    SendClientMessage(playerid, COLOR_GREY, "   Nu esti politist!");
			    return 1;
			}
	        if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)
			{
			    SendClientMessage(playerid, COLOR_GREY, "   Nu esti la datorie!");
			    return 1;
			}
			if(IsPlayerConnected(giveplayerid))
			{
			    if(giveplayerid != INVALID_PLAYER_ID)
			    {
						if(PlayerInfo[giveplayerid][pLevel] < 2) return SendClientMessage(playerid, COLOR_WHITE, "{0066FF}Ticket: {FFFFFF}Nu poti da amenda jucatorilor cu level 1!");
						format(string, sizeof(string), "* You gave %s a Ticket costing $%d, reason: %s", giveplayer, moneys, (result));
						SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
						format(string, sizeof(string), "* Offiterul %s ti-a dat o amenda in valoare de $%d, motiv: %s", sendername, moneys, (result));
						SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
						SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, "* Scrie /accept ticket, pentru a plati amenda.");
						TicketOffer[giveplayerid] = playerid;
						TicketMoney[giveplayerid] = moneys;
						return 1;
					}
					else
					{
						SendClientMessage(playerid, COLOR_GREY, "   Acel jucator nu este langa tine !");
						return 1;
					}
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "   Acel jucator este offline !");
			    return 1;
			}
		}
		ShowPlayerDialog(917, DIALOG_AMENDA, DIALOG_STYLE_LIST, "Selecteaza amenda:", "1. Folosire telefon la volan -> 5.000$ amenda\n2. Condus fara centura -> 10.000$ amenda\3. Oprire/Stationare/Parcare Neregulamentara -> 10.000$ amenda\n4. Condus neregulamentar (contra-sens, etc.) -> Suspendarea permisului + 25.000$ amenda\n5. Conducerea vehiculelor cu roti sparte -> 10.000$ amenda\n6. Folosire NOS -> Suspendarea permisului + 10.000$ amenda\n7. Folosire Hidraulice -> Suspendarea permisului + 10.000$ amenda\n8. Faruri stinse (headlights off) (pe timpul noptii, dupa ora 21:00) -> 10.000$ amenda\n9. Condus sub influenta alcoolului -> Suspendarea permisului + 20.000$ amenda\n10. Depasirea limitei de viteza cu:\n-> 10 - 50 km/h ->  10.000$ amenda\n-> 50+ km/h      -> Suspendarea permisului de conducere + 20.000$", "Select", "Close");
		return 1;
	}
1) Use strcat (clickme) to fix 'input line too long' error (I won't do it for You, as Your input line is pretty.. Yes.
2) Return some value and the very bottom of command's body.

Greetings
Reply
#3

PHP код:
CMD:ticket(playeridparams[])
{
    new 
amendatgiveplayeridstring[256], sendername[MAX_PLAYER_NAME], giveplayermoneysresult;
     if(
sscanf(params"u"amendat)) return SendClientMessage(playeridCOLOR_GRAD2"{00FF00}Folosire:{FFFFFF} /ticket[PlayerID/PartOfName]");
      if(
IsPlayerConnected(playerid))
       {
           if(!
IsACop(playerid))
        {
              
SendClientMessage(playeridCOLOR_GREY"   Nu esti politist!");
            return 
1;
        }
          if(
OnDuty[playerid] != && PlayerInfo[playerid][pMember] == 1)
        {
              
SendClientMessage(playeridCOLOR_GREY"   Nu esti la datorie!");
               return 
1;
        }
        if(
IsPlayerConnected(giveplayerid))
        {
              if(
giveplayerid != INVALID_PLAYER_ID)
            {
                if(
PlayerInfo[giveplayerid][pLevel] < 2) return SendClientMessage(playeridCOLOR_WHITE"{0066FF}Ticket: {FFFFFF}Nu poti da amenda jucatorilor cu level 1!");
                
format(stringsizeof(string), "* You gave %s a Ticket costing $%d, reason: %s"giveplayermoneys, (result));
                
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                
format(stringsizeof(string), "* Offiterul %s ti-a dat o amenda in valoare de $%d, motiv: %s"sendernamemoneys, (result));
                
SendClientMessage(giveplayeridCOLOR_LIGHTBLUEstring);
                
SendClientMessage(giveplayeridCOLOR_LIGHTBLUE"* Scrie /accept ticket, pentru a plati amenda.");
                
TicketOffer[giveplayerid] = playerid;
                
TicketMoney[giveplayerid] = moneys;
                return 
1;
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GREY"   Acel jucator nu este langa tine !");
                return 
1;
            }
        }
    }
    else
    {
         
SendClientMessage(playeridCOLOR_GREY"   Acel jucator este offline !");
           return 
1;
    }
    new 
string[1000];
    
strcat(string,"1. Folosire telefon la volan -> 5.000$ amenda\n2. Condus fara centura -> 10.000$ amenda\3. Oprire/Stationare/Parcare Neregulamentara -> 10.000$ amenda\n");
    
strcat(string,"4. Condus neregulamentar (contra-sens, etc.) -> Suspendarea permisului + 25.000$ amenda\n5. Conducerea vehiculelor cu roti sparte -> 10.000$ amenda\n6. Folosire NOS -> Suspendarea permisului + 10.000$ amenda\n");
    
strcat(string,"7. Folosire Hidraulice -> Suspendarea permisului + 10.000$ amenda\n8. Faruri stinse (headlights off) (pe timpul noptii, dupa ora 21:00) -> 10.000$ amenda\n");
    
strcat(string,"9. Condus sub influenta alcoolului -> Suspendarea permisului + 20.000$ amenda\n10. Depasirea limitei de viteza cu:\n-> 10 - 50 km/h ->  10.000$ amenda\n");
    
strcat(string,"-> 50+ km/h      -> Suspendarea permisului de conducere + 20.000$");
    
ShowPlayerDialog(917DIALOG_AMENDADIALOG_STYLE_LIST"Selecteaza amenda:"string"Select""Close");
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)