17.09.2012, 08:20
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;
}