Код:
CMD:veh(playerid, params[]) {
new Vehicle, VehicleID, Color[2], Siren, Float:pX, Float:pY, Float:pZ, Float:pA, string[123];
if(sscanf(params, "sD(1)D(1)D(1)", Vehicle, Color[0], Color[1], Siren)) return SendClientMessage(playerid, -1, "[USAGE]: /veh [VehicleName/VehicleID] [Color 1] [Color 2] [Siren 0/1]");
VehicleID = GetVehicleIDFromName(Vehicle); //error line 532
if(VehicleID == -1) {
VehicleID = strval(Vehicle);//error line 534
if(VehicleID < 400 || VehicleID > 611) return SendClientMessage(playerid, -1, "[WARNING]: Invalid vehicle ID or Name!");
}
if(Siren < 0 || Siren > 1) return SendClientMessage(playerid, -1, "[INFO]: Add siren 0/1. 0 - No, 1 - Yes.");
GetPlayerPos(playerid, pX, pY, pZ);
GetPlayerFacingAngle(playerid, pA);
DestroyVehicle(SpawnedVehicle[playerid]);
SpawnedVehicle[playerid] = CreateVehicle(VehicleID, pX, pY, pZ + 0.5, pA, Color[0], Color[1], -1, Siren);
LinkVehicleToInterior(SpawnedVehicle[playerid], GetPlayerInterior(playerid));
PutPlayerInVehicle(playerid, SpawnedVehicle[playerid], 0);
format(string, sizeof(string), "[INFO]: You successfully spawned %s (ID: %d). Enjoy it!", GetVehicleName(VehicleID), VehicleID);
SendClientMessage(playerid, -1 , string);
return 1;
}
Help, please. +rep
The text "FromName" clearly shows that the parameter is string and not integer. Change "Vehicle" to string and add size next to "s" specifier in sscanf (for example: "s[32]...").
@Konstantinos OMG That... I just didn't saw it but thank you +rep for you