16.08.2015, 11:13
Quote:
CMD:vehcolor(playerid,params []){
new color1,color2; if(sscanf(params,"dd", color1,color2)) return SendClientMessage(playerid, -1,"Usage: /vehcolor [color1] [color2]"); new currentveh = GetPlayerVehicleID(playerid); if(color1 > 255) return SendClientMessage(playerid,-1,"Invalid color id. "); if(color1 < 0 ) return SendClientMessage(playerid, -1, "Invalid color id."); if(color2 > 255) return SendClientMessage(playerid,-1,"Invalid color id. "); if(color2 < 0 ) return SendClientMessage(playerid, -1, "Invalid color id."); ChangeVehicleColor(currentveh,color1,color2); return 1; } |
if(color1 < 0 || color1 > 255 || color2 < 0 || color2 > 255) return SendClientMessage(playerid, -1, "Invalid color ID.");
would be a replacement to those 4 lines.