06.06.2012, 15:16
pawn Код:
if(strcmp(cmdtext, "/vsetcolor", true, 10) == 0)
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You must be admin to use this command!");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You must be in a vehicle to change its color!");
new
vColors[2],
iMsg[65],
ivID = GetPlayerVehicleID(playerid);
if(sscanf(params, "ii", vColors[0], vColors[1])) return SendClientMessage(playerid, -1, ""#CRED"Usage: "#CORANGE"/vSetColor < Color1 > < Color2 >");
if(OwnedVeh(ivID) != 0)
{
ChangeVehicleColor(OwnedVeh(ivID), vColors[0], vColors[1]);
vehicleinfo[OwnedVeh(ivID)][vColor1] = vColors[0];
vehicleinfo[OwnedVeh(ivID)][vColor2] = vColors[1];
format(iMsg, sizeof(iMsg), ""#CDGREEN"You've set this vehicle's color to: "#CBLUE"%i - %i", vColors[0], vColors[1]);
SendClientMessage(playerid, -1, iMsg);
SavePrivVeh(OwnedVeh(ivID));
return 1;
}
else return SendClientMessage(playerid, COLOR_RED, "This is not a buyable vehicle!");
}