simple script
#1

PHP код:
CMD:sellcar(playeridparams[])
{
    new 
targetid,type,string[128];
    if(
sscanf(params"ui"targetidtype)) return SendClientMessage(playeridCOLOR_GRAD2"INFO: {FFFFFF}/sellcar [playerid] [price]");
    if(!
IsPlayerConnected(targetid)) return SendClientMessage(playeridCOLOR_GREY"* This player is not online..");
    if(
type || type 99999999) return SendClientMessage(playeridCOLOR_GREY"* The minimum price is 0 and max price is 99999999.");
    if(
PlayerInfo[playerid][pVehOwned] < 1) return SendClientMessage(playeridCOLOR_GRAD1"You don't have a car!");
    new 
vehicle;
    
vehicle GetPlayerVehicleID(playerid);
    if(
PlayerInfo[playerid][pVeh1id] != vehicle) return SendClientMessage(playeridCOLOR_GRAD1"You are not in your car!");
    if(
PlayerInfo[targetid][pVehOwned] == 1) return SendClientMessage(playeridCOLOR_GRAD1"The person you are selling the car to, has too many of them!");
    
format(stringsizeof(string),"%s has offered you his car for $%d"RPNameplayerid ), type); 
This is what i done so far, now how could i make the "targetid" accept the offer? so for example say /accept car or "yes" or dialog pops up i dont know ;/ just need the person to accept it anyone? really really need it :/
Reply
#2

Quote:

#define DIALOG_CARSELL 9999 //on top

Quote:

ShowPlayerDialog(targetid, DIALOG_CARSELL, DIALOG_STYLE_MSGBOX, "Car sell", string, "Yes", "No"); // after has offered you his car

Quote:

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.
}

More info:
https://sampwiki.blast.hk/wiki/ShowPlayerDialog
https://sampwiki.blast.hk/wiki/OnDialogResponse
Reply
#3

I know ok, but now how am i gonna get the targetsid car details? This is my enum
PHP код:
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

oh thats not the hard bit, i would be more about the fact that how is this dialog going to know the price that playerid has offered?
Reply
#4

Anyone PLEASEEEE, been stuck with that for yearsssssss lol
Reply
#5

What do you mean by targetid's car details? Elaborate it more.
Reply
#6

No i have the details, but i need the mechanic offer with the price, then if player accepts i can set the amout the fix will cost him?

Pretty much mechanics does /fixcar ID PRICE


then the ID gets and message "You have been offered to fix ur car for PRICE"

Then when ID says /accept mechanic or simply says anything to accept the offer it will take players money nd set mechanics money +PRICE
Reply
#7

Anyone? Really need it
Reply
#8

Does no one actually know? I can't believe i still can't do it :/
Reply
#9

bump
Reply
#10

BUMP, really need it :/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)