what wrong with this? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: what wrong with this? (
/showthread.php?tid=275380)
what wrong with this? -
Horrible - 09.08.2011
FIXED
Re: what wrong with this? -
MadeMan - 09.08.2011
pawn Код:
CMD:carcolor(playerid, params[])
{
if(GetPVarInt(playerid, "rent1") != 10) return GivePlayerMoney(playerid,0);
new color1,color2;
new vehicleid = GetPlayerVehicleID(playerid);
if(sscanf(params, "ii", color1,color2))
{
ShowPlayerDialog(playerid,20,DIALOG_STYLE_LIST,"Car Rental System By Horrible/Horribles","1. Red + White\r\n2. White + Red\r\n3. Green + Blue\r\n4. Blue + Green\r\n5. Pink + White\r\n6. White + Pink","OK", "Cancel");
}
else
{
if(color1 < 0 || color1 > 255) return SendClientMessage(playerid, COLOR_GREEN, "Invalid Color Id, (0 - 255)");
if(color2 < 0 || color2 > 255) return SendClientMessage(playerid, COLOR_GREEN, "Invalid Color Id, (0 - 255)");
ChangeVehicleColor(vehicleid,color1,color2);
}
return 1;
}
Re: what wrong with this? -
Sascha - 09.08.2011
pawn Код:
new vehicleid = GetPlayerVehicleID(playerid);
{
if(sscanf(params, "ii", color1,color2)) return GivePlayerMoney(playerid,0);
if(color1 < 0 || color1 > 255) return SendClientMessage(playerid, COLOR_GREEN, "Invalid Color Id, (0 - 255)");
if(color2 < 0 || color2 > 255) return SendClientMessage(playerid, COLOR_GREEN, "Invalid Color Id, (0 - 255)");
ChangeVehicleColor(vehicleid,color1,color2);
}
else
{
ShowPlayerDialog(playerid,20,DIALOG_STYLE_LIST,"Car Rental System By Horrible/Horribles","1. Red + White\r\n2. White + Red\r\n3. Green + Blue\r\n4. Blue + Green\r\n5. Pink + White\r\n6. White + Pink","OK", "Cancel");
}
there is no "if" statement...