if (strcmp(cmd, "/speedboost", true) == 0 || strcmp(cmd, "/sb", true) == 0)
{
// Create string variables
new strBoostMultiplier;
new strTempString;
// Get the vaue typed
strBoostMultiplier = strtok(cmdtext, idx);
// Check a boost factor was supplied
if (!strlen(strBoostMultiplier))
{
// Send message and exit here
SendClientMessage(playerid, COLOR_YELLOW, "** Koriscenje: /sb ");
SendClientMessage(playerid, COLOR_YELLOW, "* Uvek mozes da stavis super ubrzanje pritiskajuci sirenu.");
SendClientMessage(playerid, COLOR_YELLOW, "* Super ubrzanje je napravio Swat001");
SendClientMessage(playerid, COLOR_YELLOW, "* Komanda za super ubrzanje je: /sb");
format(strTempString,sizeof(strTempString), "* Tvoja brzina super ubrzanja je: %0.2f", SpeedBoostMultiplier);
SendClientMessage(playerid, COLOR_YELLOW, strTempString);
return 1;
}
// Check the boost factor supplied is numeric
if (!IsNumeric2(strBoostMultiplier))
{
// Send message and exit here
SendClientMessage(playerid, COLOR_YELLOW, "** Koriscenje: /sb ");
SendClientMessage(playerid, COLOR_YELLOW, "* Uvek mozes da stavis super ubrzanje pritiskajuci sirenu.");
SendClientMessage(playerid, COLOR_YELLOW, "* Super ubrzanje je napravio Swat001");
SendClientMessage(playerid, COLOR_YELLOW, "* Komanda za super ubrzanje je: /sb");
format(strTempString,sizeof(strTempString), "* Tvoja brzina super ubrzanja je: %0.2f", SpeedBoostMultiplier);
SendClientMessage(playerid, COLOR_YELLOW, strTempString);
}
// Convert to float
new Float:BoostMultiplier = floatstr(strBoostMultiplier);
// Check speed boost multiplier is not too high or low
if (BoostMultiplier < 1.0 || BoostMultiplier > 3.0)
{
// Send message and exit here
SendClientMessage(playerid, COLOR_YELLOW, "* Izvanjavamo se ali moras da stavis ubrzanje izmenju 1.0 i 3.0");
return 1;
}
// Store the new speed boost multiplier value for the player
SpeedBoostMultiplier = BoostMultiplier;
// Format and send message
format(strTempString,sizeof(strTempString), "* Tvoje super ubrzanje je stavljeno na %0.2f", SpeedBoostMultiplier);
SendClientMessage(playerid, COLOR_YELLOW, strTempString);
// Exit here
return 1;
Ali mi ova komanda neradi, mislim sve compilram lijepo i upisem /sb 3.0 i pise da je ubrzanje stavljeno na 3.0 ali nista nije ubrzano
