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);
#define DIALOG_CARSELL 9999 //on top |
ShowPlayerDialog(targetid, DIALOG_CARSELL, DIALOG_STYLE_MSGBOX, "Car sell", string, "Yes", "No"); // after has offered you his car |
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])// under { if(dialogid == DIALOG_CARSELL) { if(response) // If they clicked 'Yes' or pressed enter { SendClientMessage(playerid, COLOR_GREEN, "Thank you for buying this car!"); } else // Pressed ESC or clicked cancel { SendClientMessage(playerid, COLOR_RED, "You not accepted."); } return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText. } return 0; // You MUST return 0 here! Just like OnPlayerCommandText. } |
enum pInfo
{
pPass,
pCash,
pAdmin,
pSex,
pAge,
Float:pPos_x,
Float:pPos_y,
Float:pPos_z,
pSkin,
pTeam,
pAccent,
pPD,
pPrawko,
pKartaMotorowerowa,
pAutoBizness,
pUrzednik,
pJobs,
pDead,
pVeh1model,
pVeh1id,
pVeh1colour1,
pVeh1colour2,
Float:pVeh1_x,
Float:pVeh1_y,
Float:pVeh1_z,
pVehOwned,
Float:pTPos_x,
Float:pTPos_y,
Float:pTPos_z,
pVeh1spawned,
pVeh1spoiler,
pVeh1roof,
pVeh1hood,
pVeh1vents,
pVeh1sideskirts,
pVeh1rearbumper,
pVeh1frontbumper,
pVeh1exhaust,
pVeh1nitro,
pVeh1wheels,
pVeh1Health,
pVeh1tyres1,
pVeh1doors1,
pVeh1panels1,
pVeh1lights1,
pOffered,
pSeller
}