Stupid Warning! - 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: Stupid Warning! (
/showthread.php?tid=245336)
Stupid Warning! -
Rokzlive - 30.03.2011
Im getting a mismatch warning on this.
pawn Код:
new Float:pay;
pay = Distance(Startx,Starty,Starty,Endx,Endy,Endz);
The stock is this.
pawn Код:
stock Float:Distance(Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2)
{
new Float:result = floatsqroot(floatpower(floatsub(x2,x1),2)+floatpower(floatsub(y2,y1),2)+floatpower(floatsub(z2,z1),2));
return result;
}
Re: Stupid Warning! -
mick88 - 31.03.2011
How are Startx,Starty,Starty,Endx,Endy,Endz defined?
pawn Код:
new Float:pay;
pay = Distance(Startx,Starty,Starty,Endx,Endy,Endz);
And most importantly, on which line do you get the warning?
Re: Stupid Warning! -
Rokzlive - 31.03.2011
They are defined locally in a stock.
That stock is
pawn Код:
stock CreatePlayerMission(playerid, bool:TrailerCheck, MissionPay2, Float:Startx, Float:Starty, Float:Startz, Float:Endx, Float:Endy, Float:Endz)
And The error is
Код:
C:\Users\Nickolas\Desktop\PWn\Server\gamemodes\bus.pwn(4809) : warning 213: tag mismatch
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Warning.
And the code is:
pawn Код:
new Float:pay;
pay = Distance(Startx,Starty,Starty,Endx,Endy,Endz);
minfo[playerid][Pay] = pay;//4809
Yeah i just noticed it was erroring on a diff line then i originally thought, but still i dnno whats wrong.
BTW what im trying to do with this system is base pay off how long the mission is, just so you know what im trying to acheive.
Re: Stupid Warning! -
mick88 - 31.03.2011
You defined Pay as a Float.
Easy fix:
pawn Код:
minfo[playerid][Pay] = floatround(pay);
Re: Stupid Warning! -
Rokzlive - 31.03.2011
Yay mick saved the day!