CMD:nrg(playerid, params[]) { new Float:x, Float:y, Float:z, Float:angle; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, angle); if(PlayerAcc[playerid][Log] == 0) return SendClientMessage(playerid, COLOR_RED, "Error: You are not logged in!"); { if(CarId[playerid] != INVALID_VEHICLE_ID) DestroyVehicle(CarId[playerid]); CarId[playerid] = CreateVehicle(522, x, y, z, angle, -1, -1, 6000); PutPlayerInVehicle(playerid, CarId[playerid], 0); SendClientMessage(playerid, COLOR_LIME, "You spawn an nrg!"); } return 1; } CMD:car(playerid, params[]) { new Float:x, Float:y, Float:z, Float:angle; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, angle); if(PlayerAcc[playerid][Log] == 0) return SendClientMessage(playerid, COLOR_RED, "Error: You are not logged in!"); { if(CarId[playerid] != INVALID_VEHICLE_ID) DestroyVehicle(CarId[playerid]); CarId[playerid] = CreateVehicle(411, x, y, z, angle, -1, -1, 6000); PutPlayerInVehicle(playerid, CarId[playerid], 0); SendClientMessage(playerid, COLOR_LIME, "You spawn an infernus!"); } return 1; }
CMD:v(playerid, params[]) { new string[128], vID[32], vid, Float:x, Float:y, Float:z, Float:ang; if(sscanf(params, "s[32]", vID)) return SendClientMessage(playerid, COLOR_RED, "Syntax: /v (carname)"); if(isnumeric(vID)) vid = strval(vID); else vid = GetVehicleModelIDFromName(vID); if (vid < 400 || vid > 611) return SendClientMessage(playerid, COLOR_RED, "Vehicle ID Maxium (Left): 400 - Maxium (Right): 611"); GetPlayerPos(playerid,x,y,z); GetPlayerFacingAngle(playerid,ang); if(CarId[playerid] != INVALID_VEHICLE_ID) DestroyVehicle(CarId[playerid]); CarId[playerid] = CreateVehicle(vid, x, y, z, ang, -1, -1, 6000); LinkVehicleToInterior(CarId[playerid], GetPlayerInterior(playerid)); SetVehicleVirtualWorld(CarId[playerid], GetPlayerVirtualWorld(playerid)); PutPlayerInVehicle(playerid, CarId[playerid], 0); format(string, sizeof(string), "You've spawned vehicle id %i - %s", vid, VehicleName[vid - 400]); SendClientMessage(playerid, COLOR_YELLOW, string); return 1; }
new PlayerVehicle[MAX_PLAYERS]; DestroyVehicle(PlayerVehicle[playerid]); PlayerVehicle[playerid] = CreateVehicle(...);
DestroyVehicle(CarId[playerid]
Delete this code from the cmds
Код:
DestroyVehicle(CarId[playerid] |
DestroyVehicle(PlayerVehicle[playerid]);
so replace that code with this?
Код:
DestroyVehicle(PlayerVehicle[playerid]); |