#2

try this .
#include <zcmd> //on top

pawn Код:
CMD:ssb(playerid, params[])
{
return cmd_setspeedboost(playerid, params);
}
CMD:setspeedboost(playerid, params[])
{
        new strBoostMultiplier[256];
        new strTempString[256];
        new Index;
        strBoostMultiplier = strtok(cmdtext, Index);
        if (isnull(strBoostMultiplier))
        {
        SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "** Usage: /setspeedboost <SpeedBoostMultiplier>");
        SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* Allows you to set the speed boost multiplier that is applied when you press the horn key.");
        SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* Accepted speed boost multiplier values are between 1.0 and 3.0");
        SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* The shortcut for this command is: /ssb");
        format(strTempString,sizeof(strTempString), "* Your current speed boost multiplier is: %0.2f", SpeedBoostMultiplier[playerid]);
        SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, strTempString);
        return 1;
        }
        if (!IsNumeric2(strBoostMultiplier))
        {
        SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "** Usage: /setspeedboost <BoostMultiplier>");
        SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* Allows you to set the speed boost multiplier that is applied when you press the horn key.");
        SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* Accepted speed boost multiplier values are between 1.0 and 3.0");
        SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* The shortcut for this command is: /ssb");
        format(strTempString,sizeof(strTempString), "* Your current speed boost multiplier is: %0.2f", SpeedBoostMultiplier[playerid]);
        SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, strTempString);
        return 1;
        }
        new Float:BoostMultiplier = floatstr(strBoostMultiplier);

        if (BoostMultiplier < 1.0 || BoostMultiplier > 3.0)
        {
        SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* Sorry, you must enter a speed boost multiplier between 1.0 and 3.0");
        return 1;
        }
        SpeedBoostMultiplier[playerid] = BoostMultiplier;
        format(strTempString,sizeof(strTempString), "* You set your speed boost multiplier to %0.2f", SpeedBoostMultiplier[playerid]);
        SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, strTempString);
        return 1;
}
Reply


Messages In This Thread
zcmd - by Fernado Samuel - 22.02.2013, 00:45
Re: zcmd - by Jewell - 22.02.2013, 02:35
Re: zcmd - by Skyrise - 22.02.2013, 02:39
Re: zcmd - by Jewell - 22.02.2013, 02:42

Forum Jump:


Users browsing this thread: 1 Guest(s)