07.09.2016, 19:15
So I'm working on this /taxi command.
Supposedly if you do /taxi fare <number>, it should update a variable.
But I found out what I'm doing is wrong, what could the alternative for this be?
Supposedly if you do /taxi fare <number>, it should update a variable.
But I found out what I'm doing is wrong, what could the alternative for this be?
Код:
CMD:taxi(playerid, params[])
{
new section[5];
if(sscanf(params, "s[5]", section))
{
SendUsageMessage(playerid, "/taxi [section]");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Sections:{FFFFFF} Duty | Fare | UPCOMING");
return 1;
}
else
{
if(strmatch(section, "fare"))
{
new farePrice;
if(sscanf(section, "i", farePrice)) return SendUsageMessage(playerid, "/fare (fare price per second)");
if(farePrice < 1 || farePrice > 10) return SendErrorMessage(playerid, "Your fare must be between $1 and $10.");
playerFare[playerid] = farePrice;
new str[50];
format(str, sizeof(str), "You have set your fare to $%i per second.", farePrice);
SendMessage(playerid, COLOR_YELLOW, str);
return 1;
}
if(strmatch(section, "duty"))
{
// code goes here - this one works however since no sscanf is called after this
}
}
return 1;
}


