11.09.2011, 13:47
Good day! I am having an problem. my vehicle command is giving out error 035: argument type mismatch (argument 1)
Whats wrong?
pawn Код:
CMD:veh(playerid, params[])
{
new Vehicle[50], color1, color2;
if(sscanf(params, "s[50]dd", Vehicle, color1, color2)) return SendClientMessage(playerid, COLOR_RED, "[SERVER]: /veh [car] [color1] [color2]");
else
{
new string[128], angle;
new veh = GetVehicleModel(Vehicle); // The problem is here
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
new PVeh = CreateVehicle(veh, X+3, Y, Z, angle, -1, -1, -1);
LinkVehicleToInterior(PVeh, GetPlayerInterior(playerid)); SetVehicleVirtualWorld(PVeh, GetPlayerVirtualWorld(playerid));
format(string, sizeof(string), "[SERVER]: You have spawned a %s. ID: %i. ", VehicleNames[veh - 400], veh);
SendClientMessage(playerid, COLOR_GREEN, string);
PutPlayerInVehicle(playerid, veh, 0);
ChangeVehicleColor(veh, color1, color2);
if(veh < 400 || veh > 611) return SendClientMessage(playerid, COLOR_RED, "Invalid Vehicle ID / Name.");
}
return 1;
}