27.12.2011, 23:55
Here you go
I hope i helped you.
I hope i helped you.
Код:
new PlayerCar[playerid]; // /v command with ZCMD and sscanf: COMMAND:v(playerid, params[]) { new carid, color1, color2; if(sscanf(params,"ddd", carid, color1, color2))return SendClientMessage(playerid, GREY, "USAGE: /v [carid] [color1] [color2]"); if(carid < 400 || carid > 611) return SendClientMessage(playerid, GREY, "Cars IDs can't be below 400 or above 611!"); else { if(color1 < 0 || color1 > 126) return SendClientMessage(playerid, GREY, "Color number can't be below 0 or above 160!"); if(color2 < 0 || color2 > 126) return SendClientMessage(playerid, GREY, "Color number can't be below 0 or above 160!"); new Float: X,Float: Y,Float: Z; GetPlayerPos(playerid, X,Y,Z); CreateVehicle(carid, X,Y,Z, 0.0, color1, color2, 60000); PutPlayerInVehicle(playerid, carid, 0); PlayerCar[playerid] = carid; } return 1; } // To despawn the vehicle when the player leaves it public OnPlayerExitVehicle(playerid, vehicleid) { if(PlayerCar[playerid] == vehicleid) { DestroyVehicle(PlayerCar[playerid]); return 1; } return 1; }