Error help - 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 help (
/showthread.php?tid=612192)
Error help -
NealPeteros - 15.07.2016
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;
Re: Error help -
FuNkYTheGreat - 15.07.2016
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;
}
Re: Error help -
NealPeteros - 15.07.2016
Ohhh, sorry. Didn't see that. Thanks, dude. Really forgot about the forward thingy.
Re: Error help -
NealPeteros - 15.07.2016
Tried it but same errors.
Re: Error help -
Konstantinos - 15.07.2016
Its name cannot start with a number. It should be either an alphabet character or underscore.
Re: Error help -
NealPeteros - 15.07.2016
Thanks, "Konstantinos"! Problem fixed.