SA-MP Forums Archive
zcmd - 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)
+--- Thread: zcmd (/showthread.php?tid=417635)



zcmd - Fernado Samuel - 22.02.2013

Removed, thanks for the help!


Re: zcmd - Jewell - 22.02.2013

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;
}



Re: zcmd - Skyrise - 22.02.2013

pawn Код:
CMD:ssb(playerid, params[])
{
return cmd_setspeedboost(playerid, params)
}
You forgot the ';' at the end of that.

Oh and the conversion is wrong...


Re: zcmd - Jewell - 22.02.2013

Oh Ty