28.08.2015, 20:20
Sscanf works probably and it sends the message with the correct usage but when I write the correct usage it gives me server unknown command?!
PHP код:
CMD:createcar(playerid, params[])
{
new model, price;
if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_RED, "Command not found on the server! /help");
if(sscanf(params,"ii",model, price)) return SendClientMessage(playerid, COLOR_RED, "Create For-Sale Car: /createcar [Modelid] (Price)");
if(model < 400 || model > 611) return SendClientMessage(playerid, COLOR_RED, "Car's modelid can't be less than 400 or more than 611!");
cAutoIncrease++;
new check[128];
format(check, sizeof(check), "SELECT * FROM cars WHERE id='%i'",cAutoIncrease);
mysql_query(1, check);
new TestID = cache_get_row_count();
if(TestID > 0) return SendClientMessage(playerid, COLOR_RED, "ID is already exist!");
new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
new vehicle = CreateVehicle(modelid, x+2, y, z, a, -1, -1, -1, 0);
BSI[vehicle] = price;
PutPlayerInVehicle(playerid, vehicle, 0);
return 1;
}