SA-MP Forums Archive
expected token: ";", but found "stock" - 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: expected token: ";", but found "stock" (/showthread.php?tid=395061)



expected token: ";", but found "stock" - Freemuffins - 25.11.2012

So, i'm having this error:

Код:
error 001: expected token: ";", but found "stock"
on this line:

Код:
stock PlayerName(playerid)
{
	new pName[MAX_PLAYER_NAME];
	GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
	return pName;
}
Anyone know how to fix it?


Re: expected token: ";", but found "stock" - Glad2BeHere - 25.11.2012

pawn Код:
stock PlayerName(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    return name;
}



Re: expected token: ";", but found "stock" - Freemuffins - 25.11.2012

Quote:
Originally Posted by Glad2BeHere
Посмотреть сообщение
pawn Код:
stock PlayerName(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    return name;
}
Still getting the same error message when I go to compile it


Re: expected token: ";", but found "stock" - yaron0600 - 25.11.2012

Look , Get all the line but in error's detail's in "(())" That's he write you what the line of error's what exctly the line update it with all what connect to this... and we'll see...


Re: expected token: ";", but found "stock" - Freemuffins - 25.11.2012

Quote:
Originally Posted by yaron0600
Посмотреть сообщение
Look , Get all the line but in error's detail's in "(())" That's he write you what the line of error's what exctly the line update it with all what connect to this... and we'll see...
Код:
C:\Users\Jayden\Desktop\samp server\filterscripts\avs.pwn(510) : error 001: expected token: ";", but found "stock"

Код:
stock PlayerName(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    return name;
}



Re: expected token: ";", but found "stock" - Bakr - 25.11.2012

The error (missing a semi-colon) is on a line or two before that of which the compiler is giving you.


Re: expected token: ";", but found "stock" - Freemuffins - 25.11.2012

Quote:
Originally Posted by Bakr
Посмотреть сообщение
The error (missing a semi-colon) is on a line or two before that of which the compiler is giving you.
Yup, that worked. How didn't I notice that :3


I needed to do this:


Код:
forward StopAlarm(vehicleid); // add this

stock PlayerName(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    return name;
}
+1, Solved


Re: expected token: ";", but found "stock" - Glad2BeHere - 25.11.2012

Show the Lines Before that its not that stock it has to something else show lines before or even entire script


Re: expected token: ";", but found "stock" - Bakr - 25.11.2012

Quote:
Originally Posted by Glad2BeHere
Посмотреть сообщение
Show the Lines Before that its not that stock it has to something else show lines before or even entire script
I'm not glad you're here.

Also, how are you "becoming certified" in a language you do not even know the name of?