Tag Mismatch
#1

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
Reply
#2

Try replacing %d with %f.
Reply
#3

Код:
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.
Reply
#4

pawn Код:
Float:speed,
Reply
#5

lol; it's what smeti said. Just put a Float: tag before it.
Reply
#6

Thanks.
Reply
#7

Also don't forget to change what Grim_ said.
Reply
#8

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.

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)