Tag Mismatch - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Tag Mismatch (
/showthread.php?tid=162795)
Tag Mismatch -
Nonameman - 24.07.2010
Hey Guys!
I got a warning in my script:
Код:
C:\Documents and Settings\Bence\Asztal\sa.mp\gamemodes\Fun.pwn(762) : warning 213: tag mismatch
Here is the function:
pawn Код:
public SpeedoTimer(playerid)
{
new
Float:pos[3],
speed,
str[128];
GetVehicleVelocity(GetPlayerVehicleID(playerid), pos[0], pos[1], pos[2]);
speed = floatsqroot(floatpower(pos[0], 2)+floatpower(pos[1], 2)+floatpower(pos[2], 2))*160.0;
format(str, sizeof(str), "~b~-~n~~w~%d ~g~km/h~n~~w~%d ~r~mp/h", floatround(speed, floatround_round), floatround(speed/1.6, floatround_round));//line 762
TextDrawSetString(Speedometer[0], str);
return 1;
}
Which parameter is bad?
Nonameman
Re: Tag Mismatch -
Grim_ - 24.07.2010
Try replacing %d with %f.
Re: Tag Mismatch -
DJDhan - 24.07.2010
Код:
format(str, sizeof(str), "~b~-~n~~w~%f ~g~km/h~n~~w~%f ~r~mp/h", floatround(speed, floatround_round), floatround);
Try that, if that doesn't work, then it's probably "floatround(speed, floatround_round)" that is the problem.
Re: Tag Mismatch -
smeti - 24.07.2010
Re: Tag Mismatch -
RyDeR` - 24.07.2010
lol; it's what smeti said. Just put a Float: tag before it.
Re: Tag Mismatch -
Nonameman - 24.07.2010
Thanks.
Re: Tag Mismatch -
RyDeR` - 24.07.2010
Also don't forget to change what Grim_ said.
Re: Tag Mismatch -
smeti - 24.07.2010
Quote:
Originally Posted by RyDeR`
Also don't forget to change what Grim_ said.
|
a-a
pawn Код:
floatround(speed, floatround_round) = integer!
https://sampwiki.blast.hk/wiki/Floatround
Quote:
Round a floating point number to an integer value.
|