dcmd_ctires(playerid,params[])
{
#pragma unused params
new tires;
if(sscanf(params, "i", tires)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ctires [#tires]");
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid,COLOR_GREY,"* You are not an administrator or not logged in as RCON!");;
if(!IsPlayerInAnyVehicle(playerid)){ return SendClientMessage(playerid,COLOR_RED,"* You're not in a vehicle."); }
if(tires < 0 || tires > 15){ return SendClientMessage(playerid,COLOR_RED,"Between 0 and 14"); }
if(tires == 1) AddVehicleComponent(GetPlayerVehicleID(playerid),1073);
if(tires == 2) AddVehicleComponent(GetPlayerVehicleID(playerid),1074);
if(tires == 3) AddVehicleComponent(GetPlayerVehicleID(playerid),1075);
if(tires == 4) AddVehicleComponent(GetPlayerVehicleID(playerid),1076);
if(tires == 5) AddVehicleComponent(GetPlayerVehicleID(playerid),1077);
if(tires == 6) AddVehicleComponent(GetPlayerVehicleID(playerid),1078);
if(tires == 7) AddVehicleComponent(GetPlayerVehicleID(playerid),1079);
if(tires == 8) AddVehicleComponent(GetPlayerVehicleID(playerid),1080);
if(tires == 9) AddVehicleComponent(GetPlayerVehicleID(playerid),1081);
if(tires == 10) AddVehicleComponent(GetPlayerVehicleID(playerid),1082);
if(tires == 11) AddVehicleComponent(GetPlayerVehicleID(playerid),1083);
if(tires == 12) AddVehicleComponent(GetPlayerVehicleID(playerid),1084);
if(tires == 13) AddVehicleComponent(GetPlayerVehicleID(playerid),1085);
new string[128];
format(string, sizeof(string), "* Your car tires have been changed!");
SendClientMessage(playerid,COLOR_ORANGE,string);
return true;
}
public OnPlayerCommandText(playerid,cmdtext[]){
dcmd(ctires,6,cmdtext);
if(tires == 1) AddVehicleComponent(GetPlayerVehicleID(playerid),1073);
if(tires == 2) AddVehicleComponent(GetPlayerVehicleID(playerid),1074);
if(tires == 3) AddVehicleComponent(GetPlayerVehicleID(playerid),1075);
if(tires == 4) AddVehicleComponent(GetPlayerVehicleID(playerid),1076);
if(tires == 5) AddVehicleComponent(GetPlayerVehicleID(playerid),1077);
if(tires == 6) AddVehicleComponent(GetPlayerVehicleID(playerid),1078);
if(tires == 7) AddVehicleComponent(GetPlayerVehicleID(playerid),1079);
if(tires == 8) AddVehicleComponent(GetPlayerVehicleID(playerid),1080);
if(tires == 9) AddVehicleComponent(GetPlayerVehicleID(playerid),1081);
if(tires == 10) AddVehicleComponent(GetPlayerVehicleID(playerid),1082);
if(tires == 11) AddVehicleComponent(GetPlayerVehicleID(playerid),1083);
if(tires == 12) AddVehicleComponent(GetPlayerVehicleID(playerid),1084);
if(tires == 13) AddVehicleComponent(GetPlayerVehicleID(playerid),1085);
AddVehicleComponent(GetPlayerVehicleID(playerid),1073 + tires);
new string[128]; format(string, sizeof(string), "* Your car tires have been changed!"); SendClientMessage(playerid,COLOR_ORANGE,string);
SendClientMessage(playerid,COLOR_ORANGE,"* Your car tires have been changed!");
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid,COLOR_GREY,"* You are not an administrator or not logged in as RCON!");;
+
don't use sscanf to read only one integer parameter use strval. also, Код:
new string[128]; format(string, sizeof(string), "* Your car tires have been changed!"); SendClientMessage(playerid,COLOR_ORANGE,string); Код:
SendClientMessage(playerid,COLOR_ORANGE,"* Your car tires have been changed!"); Код:
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid,COLOR_GREY,"* You are not an administrator or not logged in as RCON!");; |