/vehcolor CMD Problem.
#5

Quote:
Originally Posted by ZToPMaN
Посмотреть сообщение
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;
}
Why use 4 lines for something that can be done in 1? Or in 2 if you want it to look good.

if(color1 < 0 || color1 > 255 || color2 < 0 || color2 > 255) return SendClientMessage(playerid, -1, "Invalid color ID.");

would be a replacement to those 4 lines.
Reply


Messages In This Thread
/vehcolor CMD Problem. - by TitanForceGeneral - 16.08.2015, 10:35
Re: /vehcolor CMD Problem. - by LetsOWN[PL] - 16.08.2015, 10:46
Re: /vehcolor CMD Problem. - by ZToPMaN - 16.08.2015, 10:57
Re: /vehcolor CMD Problem. - by TitanForceGeneral - 16.08.2015, 11:12
Re: /vehcolor CMD Problem. - by Denying - 16.08.2015, 11:13
Re: /vehcolor CMD Problem. - by MarvinPWN - 16.08.2015, 11:13
Re: /vehcolor CMD Problem. - by TitanForceGeneral - 16.08.2015, 11:15
Re: /vehcolor CMD Problem. - by MarvinPWN - 16.08.2015, 11:17
Re: /vehcolor CMD Problem. - by TitanForceGeneral - 16.08.2015, 11:23
Re: /vehcolor CMD Problem. - by Denying - 16.08.2015, 11:29

Forum Jump:


Users browsing this thread: 3 Guest(s)