float 1 and 2.
#1

Hello,
I wanted to ask that how to get the float 1 and float to when added to a command?Let me explain:
Like if there is a command like /blabla <first number><second number>,
And then use it in my script like First float,Second float
You know that can be used to make a calculate I guess.
ThAnKs!.
Reply
#2

Depends, what floats are you getting?
the float the player inputs, or some other float?

if you search for the input, use sscanf..
simple command:
pawn Код:
CMD:output(playerid,params[])
{
    new Float:f1,Float:f2;//make a new float var
    if(sscanf(params,"ff",f1,f2)) return SendClientMessage(playerid,COLOR_WHITE,"Usage: /output <float1><float2>");//detect if the player has put in the floats
    new Float:output = f1+f2;//count the floats
    new string[128];//create string var
    format(string,sizeof(string),"These two floats output: %f",output);//format the string var with our output
    SendClientMessage(playerid,COLOR_WHITE,string);//send a message containing the formatted string
    return 1;
}
this will count the floats to eachother
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)