warning 213: tag mismatch -
SpikY_ - 29.12.2015
I can't figure out the Problem in the snippet.
PHP код:
stock PlayerPosition(playerid, Float:X, Float:Y, Float:Z)
{
new Float:XP,Float:YP,Float:ZP;
GetPlayerPos(playerid,XP,YP,ZP);
return (XP - X) + (YP - Y) + (ZP - Z); //error line
}
Re: warning 213: tag mismatch -
graef - 29.12.2015
I've googling and found it:
https://sampforum.blast.hk/showthread.php?tid=73158
You need to declare float before function name
Код:
Float:TestF(a, b) {}
Re: warning 213: tag mismatch -
SpikY_ - 29.12.2015
Sigh much errors.
Re: warning 213: tag mismatch -
graef - 29.12.2015
So, the solution didn't work? i've tried that before reply.
* You need to write the function before call it
exmpl:
PHP код:
// warning 208: function with tag result used before definition, forcing reparse
main {
testfunct();
}
Float:testfunct() {
return 0.0;
}
// So you need to do it like the image below.
Re: warning 213: tag mismatch -
SpikY_ - 29.12.2015
So Probably you were Right. I tried it like this and its compiled:
PHP код:
forward Float:PlayerPosition(playerid, Float:X, Float:Y, Float:Z);
stock Float:PlayerPosition(playerid, Float:X, Float:Y, Float:Z)
{
new Float:XP,Float:YP,Float:ZP;
GetPlayerPos(playerid,XP,YP,ZP);
return (XP - X) + (YP - Y) + (ZP - Z);
}
=======================
Lazy to create another thread for other Errors, so have a look
Error:
Код:
error 076: syntax error in the expression, or invalid function call
PHP код:
new Str[300];
format(Str, sizeof(Str), "%d/%d", ClosestDis, GetPlayersOnServer); //Error in GetPlayersOnServer Possibily
TextDrawSetString(Textdraw15, Str);
PHP код:
stock GetPlayersOnServer()
{
new count;
for(new x=0; x< MAX_PLAYERS; x++)
{
if(IsPlayerConnected(x)))
{
count++;
}
}
return count;
}
Re: warning 213: tag mismatch -
graef - 29.12.2015
//1
format(Str, sizeof(Str), "%d/%d", ClosestDis, GetPlayersOnServer
());
//2
if(IsPlayerConnected(x)
))
*Red - Delete it
*Blue - Add it
Re: warning 213: tag mismatch -
SpikY_ - 29.12.2015
Код:
warning 219: local variable "count" shadows a variable at a preceding level
PHP код:
stock GetPlayersOnServer()
{
new count; //This line
for(new x=0; x< MAX_PLAYERS; x++)
{
if(IsPlayerConnected(x))
{
count++;
}
}
return count;
}
EDIT:nvm fixed, just replace the variable name.