SA-MP Forums Archive
Returns wrong - 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: Returns wrong (/showthread.php?tid=263929)



Returns wrong - Unknown123 - 24.06.2011

pawn Code:
new Float:Thing[MAX_PLAYERS];

COMMAND:thing(playerid, params[])
{
    new thing, string[128];
    if(sscanf(params, "f", thing)) return SendClientMessage(playerid, -1, "/speed (speed)");
    {
        Thing[playerid] = thing;

        format(string, sizeof(string), "You changed the thing to %f", Thing[playerid]);
        SendClientMessage(playerid, -1, string);
    }
    return 1;
}
if i type "/thing 20.0"
then it sais "You changed the thing to 11010048000.000000"
but it should say "You changed the thing to 20.000000"


Re: Returns wrong - Laronic - 24.06.2011

Chnage
Code:
new thing, string[128];
//to 
new Float:thing, string[128];



Re: Returns wrong - Unknown123 - 24.06.2011

Thnax man it worked!