Floats confusion
#3

pawn Код:
CMD:calculate(playerid, params[])
{
    new Float:Value1, Method[20], Float:Value2, string[128];
    if(sscanf(params, "ffs", Value1, Value2, Method))
    {
        SendClientMessage(playerid, GREY, "SYNTAX: /calc(ulate) [value] [value] [method]");
        SendClientMessage(playerid, GREY, "Method: Add, Subtract, Multiply & Divide.");
    }
    else
    {
        if(strcmp(Method, "add", true) == 0)
        {
            new Float:Sum = Value1 + Value2;
            format(string, sizeof(string), "%f + %f = %f.", Value1, Value2, Sum);
            SendClientMessage(playerid, WHITE, string);
        }
    }
    return 1;
}
Reply


Messages In This Thread
Floats confusion - by cosbraa - 17.09.2012, 07:00
Re: Floats confusion - by clarencecuzz - 17.09.2012, 07:55
Re: Floats confusion - by cosbraa - 17.09.2012, 08:20
Re: Floats confusion - by clarencecuzz - 17.09.2012, 08:26
Re: Floats confusion - by cosbraa - 17.09.2012, 09:11
Re: Floats confusion - by Roko_foko - 17.09.2012, 09:19
Re: Floats confusion - by [ABK]Antonio - 17.09.2012, 09:20

Forum Jump:


Users browsing this thread: 1 Guest(s)