10.08.2016, 13:42
PHP код:
CMD:ssb(playerid,params[])
{
new boost;
new strBoostMultiplier[256];
new strTempString[267];
if(sscanf(params,"f",boost))
{
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");
return 1;
}
new Float:BoostMultiplier = floatstr(strBoostMultiplier);
// Check speed boost multiplier is not too high or low
if (boost < 1.0 || boost > 3.0)
{
// Send message and exit here
SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "* Sorry, you must enter a speed boost multiplier between 1.0 and 3.0");
return 1;
}
SpeedBoostMultiplier[playerid] = boost;
format(strTempString,sizeof(strTempString), "* You set your speed boost multiplier to %0.2f", SpeedBoostMultiplier[playerid]);
SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, strTempString);
return 1;
}
PHP код:
* Sorry, you must enter a speed boost multiplier between 1.0 and 3.0