12.04.2012, 01:51
pawn Код:
enum pInfo
{
pPass,
pCash,
pAdmin,
pTutorial,
pSex,
pAge,
Float:pPos_x,
Float:pPos_y,
Float:pPos_z,
pSkin,
pTeam,
pAccent,
pFrozen,
PCarMods,
pVehicle, // added this, the variable to store the player's vehicle ID
};
// i'll assume that you're also using PlayerInfo
new PlayerInfo[MAX_PLAYERS][pInfo];
pawn Код:
if(dialogid == DIALOG_BUYVEHICLE)
{
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, DIALOG_CASUALVEHICLEMENU, DIALOG_STYLE_LIST, "Casual Car Menu", "TEST CAR - SENITAL", "Buy", "Cancel");
}
}
return 1;
}
if(dialogid == DIALOG_CASUALVEHICLEMENU)
{
if(response)
{
if(listitem == 0)
{
new vehicle; // added this
vehicle = CreateVehicle(405, 540.0750,-1281.7159,17.2422,309.3207, 0, 1, 0);
// lines added below
PutPlayerInVehicle(playerid, vehicle, 0);
new PlayerVehicle = GetPlayerVehicleID(playerid);
PlayerInfo[playerid][pVehicle] = PlayerVehicle;
}
}
return 1;
}