22.02.2012, 17:14
hello im making a /sellto command for vehicle system, i would like to know if there is anyway to export id from code:
to ondialogresponse, basicly i want to set is vehicle owner of the seller to 0 and the buyer to 1, but i have no idea how to get the seller id in ondialogresponse
pawn Код:
CMD:sellto(playerid, params[])
{
if(!isvehicleowner = 1 && IsPlayerInAnyVehicle) return SendClientMessage(playerid, COLOR_BLUE, "You are not the vehicle owner");
new str[128], id, price, pname, name[MAX_PLAYER_NAME];
if(sscanf(params, "ud", id, price)) return SendClientMessage(playerid, COLOR_BLUE, "Use: /sellto [playerid] [Price]");
pname = GetPlayerName(playerid, name, sizeof(name));
format(str, sizeof(str), "Player %s wants to sell a vehicle to you", pname);
ShowPlayerDialog(id, DIALOG_SELLTO_VEHICLE, DIALOG_STYLE_MSGBOX, "Offer", str, "Buy", "Nope");
return 1;
}
if(dialogid == DIALOG_SELLTO_VEHICLE)
{
if(response)
{
if(pinfo[playerid][money] < vehprice) return SendClientMessage(playerid, COLOR_BLUE, "You dont got the money!");
IsVehicleOwner[id] = 0;
IsVehicleOwner[playerid] = 1;
}
}