Error help
#1

While I was scripting a job, I got these errors. Please help.

pawn Код:
(104704) : error 001: expected token: "-identifier-", but found "5"
(104708) : error 010: invalid function or declaration
(104711) : error 001: expected token: "-identifier-", but found "5"
(104714) : error 010: invalid function or declaration
Here are the lines
pawn Код:
public 555phone(playerid)
{
    SendClientMessage(playerid, COLOR_YELLOW, "Good day, and thanks for calling LTS. We might have a job for you.");
    SetTimerEx("555phone1", 10000, false, "i", playerid);
    return 1;
}

public 555phone1(playerid)
{
    SendClientMessage(playerid, COLOR_YELLOW, "Perfect! We've got a job available. Please hold on.");
    return 1;
}
And in case you are wondering why I made this part, here it is
pawn Код:
CMD:call(playerid, params[])
{
    new string[128], phonenumb;

    if(sscanf(params, "d", phonenumb))
    {
        SendClientMessageEx(playerid, COLOR_GRAD2, "Land Transport Exclusives - 555");
        return 1;
    }

    if(phonenumb == 555)
    {
    foreach(Player, i)
    {
        if(Mobile[i] == playerid)
        {
            Mobile[playerid] = i; //caller connecting
            SendClientMessageEx(i,  COLOR_GRAD2, " An unknown man picked up the call.");
            RingTone[playerid] = 0;
            SetTimerEx("555phone", 1500, false, "i", playerid);
            return SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
        }
    }
}
    return 1;
Reply
#2

change this
Код:
public 555phone(playerid)
{
	SendClientMessage(playerid, COLOR_YELLOW, "Good day, and thanks for calling LTS. We might have a job for you.");
	SetTimerEx("555phone1", 10000, false, "i", playerid);
	return 1;
}

public 555phone1(playerid)
{
	SendClientMessage(playerid, COLOR_YELLOW, "Perfect! We've got a job available. Please hold on.");
	return 1;
}
To This
Код:
forward 555phone(playerid);
public 555phone(playerid)
{
	SendClientMessage(playerid, COLOR_YELLOW, "Good day, and thanks for calling LTS. We might have a job for you.");
	SetTimerEx("555phone1", 10000, false, "i", playerid);
	return 1;
}
forward 555phone1(playerid);
public 555phone1(playerid)
{
	SendClientMessage(playerid, COLOR_YELLOW, "Perfect! We've got a job available. Please hold on.");
	return 1;
}
Reply
#3

Ohhh, sorry. Didn't see that. Thanks, dude. Really forgot about the forward thingy.
Reply
#4

Tried it but same errors.
Reply
#5

Its name cannot start with a number. It should be either an alphabet character or underscore.
Reply
#6

Thanks, "Konstantinos"! Problem fixed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)