20.01.2012, 18:46
Here's mine
have to alter it to your needs.
Код:
CMD:colourcar(playerid, params[]) { if(jobVariables[playerVariables[playerid][pJob]][jJobType] == 3) { new colors[2], Float: soPos[3], vehicleID = GetPlayerVehicleID(playerid); if(sscanf(params, "dd", colors[0], colors[1])) { return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/colourcar [colour 1] [colour 2]"); } else if(vehicleID) { if(playerVariables[playerid][pJobDelay] == 0) { // DELAY!1 if(GetPlayerSpeed(playerid, 0) == 0) { if(colors[0] >= 0 && colors[0] < 256 && colors[1] >= 0 && colors[1] < 256) { GetVehiclePos(vehicleID, soPos[0], soPos[1], soPos[2]); PlayerPlaySoundEx(1134, soPos[0], soPos[1], soPos[2]); ChangeVehicleColor(vehicleID, colors[0], colors[1]); foreach(Player, v) { if(playerVariables[v][pCarID] == vehicleID) { playerVariables[v][pCarColour][0] = colors[0]; playerVariables[v][pCarColour][1] = colors[1]; } } SendClientMessage(playerid, COLOR_WHITE, "You have resprayed your vehicle."); playerVariables[playerid][pJobDelay] = 60; } else SendClientMessage(playerid, COLOR_WHITE, "Valid vehicle colours are 0 to 255."); } else SendClientMessage(playerid, COLOR_WHITE, "You must stop your vehicle first."); } else SendClientMessage(playerid, COLOR_WHITE, "Please wait your job reload time."); } } return 1; }