SA-MP Forums Archive
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=55431)



tag mismatch - Pawel_Shark - 16.11.2008

Код:
	format(string, sizeof(string), "~n~~n~~n~~n~~n~~n~~n~~n~~n~~r~~n~~r~Km/h: ~g~%d ",floatround(value/2200));
	GameTextForPlayer(playerid,string,850,3);
Код:
D:\ServerDm\gamemodes\lvdm.pwn(670) : warning 213: tag mismatch
D:\ServerDm\gamemodes\lvdm.pwn(671) : warning 213: tag mismatch
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.



Re: tag mismatch - Pawel_Shark - 16.11.2008

i got that
Код:
	new Float:string[256],Float:value,Float:distance,Float:x,Float:y,Float:z;
Quote:

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{

new Floattring[256],Float:value,Float:distance,Float,Float:y,Float: z;
GetPlayerPos(playerid, x, y, z);
distance = floatsqroot(floatpower(floatabs(floatsub(x,PlayerP os[playerid][X])),2)+floatpower(floatabs(floatsub(y,PlayerPos[playerid][Y])),2)+floatpower(floatabs(floatsub(z,PlayerPos[playerid][Z])),2));
value = floatround(distance * 11000);
format(string, sizeof(string), "~n~~n~~n~~n~~n~~n~~n~~n~~n~~r~~n~~r~Km/h: ~g~%d ",floatround(value/2200));
GameTextForPlayer(playerid,string,850,3);
return 1;
}




Re: tag mismatch - ғαιιοцт - 23.02.2009

floatround(value/2200)
the bold part retruns an integer
you can't round an integer

so just use this:
Код:
format(string, sizeof(string), "~n~~n~~n~~n~~n~~n~~n~~n~~n~~r~~n~~r~Km/h: ~g~%d ",value/2200);



Re: tag mismatch - ғαιιοцт - 23.02.2009

Quote:
Originally Posted by ssǝן‾ʎ
Strings are strings, not floats.
i didn't say so


Re: tag mismatch - Daren_Jacobson - 23.02.2009

what ****** means is

new Floattring[256]

should be

new string[256]