18.02.2015, 22:13
Sooooo
spawning by name doesn't works.
WHY?!
spawning by name doesn't works.
WHY?!
Код:
CMD:v(playerid, params[]) { new id; new car; new Vehicle[32], VehicleID; new Float:x, Float:y; new Float:x2, Float:y2, Float:z; new worldid = GetPlayerVirtualWorld(playerid); if(sscanf(params, "d", id)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /v [ID/name]"); if(id > 611 || id < 400) { return SendClientMessage(playerid, COLOR_GREY,"Error: Bad ID or name."); } else { GetXYInFrontOfPlayer(playerid, x, y, 5.0); GetPlayerPos(playerid, x2, y2, z); car = CreateVehicle(id, x, y, z, 0.0, 255, 255, -1); SetVehicleVirtualWorld(car, worldid); } if(sscanf(params, "s[32]", Vehicle)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /v [ID/name]"); { VehicleID = GetVehicleModelIDFromName(Vehicle); GetXYInFrontOfPlayer(playerid, x, y, 5.0); GetPlayerPos(playerid, x2, y2, z); VehicleID = CreateVehicle(VehicleID, x, y, z, 0.0, 255, 255, -1); SetVehicleVirtualWorld(VehicleID, worldid); } return 1; }