15.11.2012, 21:25
PHP код:
CMD:sellcar(playerid, params[])
{
new targetid,type,string[128];
if(sscanf(params, "ui", targetid, type)) return SendClientMessage(playerid, COLOR_GRAD2, "INFO: {FFFFFF}/sellcar [playerid] [price]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "* This player is not online..");
if(type < 0 || type > 99999999) return SendClientMessage(playerid, COLOR_GREY, "* The minimum price is 0 and max price is 99999999.");
if(PlayerInfo[playerid][pVehOwned] < 1) return SendClientMessage(playerid, COLOR_GRAD1, "You don't have a car!");
new vehicle;
vehicle = GetPlayerVehicleID(playerid);
if(PlayerInfo[playerid][pVeh1id] != vehicle) return SendClientMessage(playerid, COLOR_GRAD1, "You are not in your car!");
if(PlayerInfo[targetid][pVehOwned] == 1) return SendClientMessage(playerid, COLOR_GRAD1, "The person you are selling the car to, has too many of them!");
format(string, sizeof(string),"%s has offered you his car for $%d", RPName( playerid ), type);