Posts: 547
Threads: 57
Joined: Dec 2010
Quote:
Originally Posted by Konstantinos
pawn Код:
CreateVehicle(vehid, pX+5, pY+5, pZ, pA, color1, color2, 180); format(string, sizeof(string), "[AdminCMD] You have just spawned a %s.", GetVehicleName(vehid));
You pass the modelid as vehicleid which is incorrect and if you had checked in GetVehicleName the modelid, you could prevent it.
Change to:
pawn Код:
new veh_ID = CreateVehicle(vehid, pX+5, pY+5, pZ, pA, color1, color2, 180); format(string, sizeof(string), "[AdminCMD] You have just spawned a %s.", GetVehicleName(veh_ID));
pawn Код:
stock GetVehicleName(vehicleid) { new string[28] = "N/A"; if (GetVehicleModel(vehicleid)) strcat((string[0] = '\0', string), VehicleNames[GetVehicleModel(vehicleid) - 400], sizeof (string)); return string; }
|
This fixed it. Thanks man.