31.10.2015, 16:15
I see you are using ShowModelSelectionEx but not OnPlayerModelSelectionEx, try this:
pawn Код:
public OnPlayerModelSelectionEx(playerid, response, extraid, modelid)
{
if(extraid == AIRCRAFT)
{
if(response)
{
if(ForwardOwnCar(1,playerid)) { SendClientMessage(playerid,COLOR_GREY,"You must park ( despawn ) your vehicle before you can buy another"); return 1; }
else if(ForwardOwnCar(2,playerid)) { SendClientMessage(playerid,COLOR_GREY,"You must park ( despawn ) your vehicle before you can buy another"); return 1; }
else if(ForwardOwnCar(3,playerid)) { SendClientMessage(playerid,COLOR_GREY,"You must park ( despawn ) your vehicle before you can buy another"); return 1; }
else if(ForwardOwnCar(4,playerid)) { SendClientMessage(playerid,COLOR_GREY,"You must park ( despawn ) your vehicle before you can buy another"); return 1; }
else if(ForwardOwnCar(5,playerid)) { SendClientMessage(playerid,COLOR_GREY,"You must park ( despawn ) your vehicle before you can buy another"); return 1; }
if(PlayerInfo[playerid][pCarkey] != SCRIPT_CARS && PlayerInfo[playerid][pCarkey2] != SCRIPT_CARS && PlayerInfo[playerid][pCarkey3] != SCRIPT_CARS && PlayerInfo[playerid][pCarkey4] != SCRIPT_CARS && PlayerInfo[playerid][pCarkey5] != SCRIPT_CARS)
{
SendClientMessage(playerid,COLOR_GREY,"You already have 5 vehicles, you will need to sell one first.");
return 1;
}
if(modelid == 0 && PlayerInfo[playerid][pAccount] > 8999999) // Maveric
{
new found = 0;
for(new i = 0; i < sizeof(CarInfo); i++)
{
if(found != 1)
{
if(CarInfo[i][cOwnedCar] == 0)
{
found = 1;
CarInfo[i][cMod][0] = 0;
CarInfo[i][cMod][1] = 0;
CarInfo[i][cMod][2] = 0;
CarInfo[i][cMod][3] = 0;
CarInfo[i][cMod][4] = 0;
CarInfo[i][cMod][5] = 0;
CarInfo[i][cMod][6] = 0;
CarInfo[i][cMod][7] = 0;
CarInfo[i][cMod][8] = 0;
CarInfo[i][cMod][9] = 0;
if(PlayerInfo[playerid][pCarkey] == SCRIPT_CARS)
{
PlayerInfo[playerid][pCarkey] = i;
}
else if(PlayerInfo[playerid][pCarkey2] == SCRIPT_CARS)
{
PlayerInfo[playerid][pCarkey2] = i;
}
else if(PlayerInfo[playerid][pCarkey3] == SCRIPT_CARS)
{
PlayerInfo[playerid][pCarkey3] = i;
}
else if(PlayerInfo[playerid][pCarkey4] == SCRIPT_CARS)
{
PlayerInfo[playerid][pCarkey4] = i;
}
else if(PlayerInfo[playerid][pCarkey5] == SCRIPT_CARS)
{
PlayerInfo[playerid][pCarkey5] = i;
}
new string[250];
new sendername[MAX_PLAYER_NAME];
format(string, sizeof(string), ""COL_GREY"You have purchased a new Maveric, for $9000000, type {FF6347}/v help"COL_GREY" for details.");
SendClientMessage(playerid,COLOR_GREY,string);
SendClientMessage(playerid,COLOR_GREY,""COL_GREY"You must set your Maveric's spawn using {FF6347}/v setpark"COL_GREY" as soon as possible.");
SendClientMessage(playerid,COLOR_GREY,""COL_GREY"Los Santos Aircraft: We have parked your {FF6347}Maveric"COL_GREY" at Los Santos Airport");
PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-9000000;
CarInfo[i][cOwnedCar] = 1;
CarInfo[i][cModel] = 487;
format(string, sizeof(string), "Maveric");
strmid(CarInfo[i][cDescription], string, 0, strlen(string), 255);
CarInfo[i][cValue] = 9000000;
CarInfo[i][cColorOne] = 13;
CarInfo[i][cColorTwo] = 13;
CarInfo[i][cLock] = 0;
CarInfo[i][cLocationx] = 1993.2000;
CarInfo[i][cLocationy] = -2382.3000;
CarInfo[i][cLocationz] = 14.5000;
CarInfo[i][cAngle] = 90.00;
CarInfo[i][cDonate] = 0;
CarInfo[i][cTrunkWep][1] = 0;
CarInfo[i][cTrunkWep][2] = 0;
CarInfo[i][cTrunkWep][3] = 0;
CarInfo[i][cTrunkWep][4] = 0;
CarInfo[i][cTrunkAmmo][1] = 0;
CarInfo[i][cTrunkAmmo][2] = 0;
CarInfo[i][cTrunkAmmo][3] = 0;
CarInfo[i][cTrunkAmmo][4] = 0;
CarInfo[i][cTrunkArmour] = 0.0;
CarInfo[i][cTrunkCounter] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s", sendername);
strmid(CarInfo[i][cOwner], string, 0, strlen(string), 255);
new carid = AddStaticVehicleEx(CarInfo[i][cModel],CarInfo[i][cLocationx],CarInfo[i][cLocationy],CarInfo[i][cLocationz]+1,CarInfo[i][cAngle],CarInfo[i][cColorOne],CarInfo[i][cColorTwo],3600);
VehicleOwned[carid] = i;
UpdateAccount(playerid);
SaveCars();
return 1;
}
}
}
}
if(modelid == 1 && PlayerInfo[playerid][pAccount] > 6999999) // Sparrow
{
new found = 0;
for(new i = 0; i < sizeof(CarInfo); i++)
{
if(found != 1)
{
if(CarInfo[i][cOwnedCar] == 0)
{
found = 1;
CarInfo[i][cMod][0] = 0;
CarInfo[i][cMod][1] = 0;
CarInfo[i][cMod][2] = 0;
CarInfo[i][cMod][3] = 0;
CarInfo[i][cMod][4] = 0;
CarInfo[i][cMod][5] = 0;
CarInfo[i][cMod][6] = 0;
CarInfo[i][cMod][7] = 0;
CarInfo[i][cMod][8] = 0;
CarInfo[i][cMod][9] = 0;
if(PlayerInfo[playerid][pCarkey] == SCRIPT_CARS)
{
PlayerInfo[playerid][pCarkey] = i;
}
else if(PlayerInfo[playerid][pCarkey2] == SCRIPT_CARS)
{
PlayerInfo[playerid][pCarkey2] = i;
}
else if(PlayerInfo[playerid][pCarkey3] == SCRIPT_CARS)
{
PlayerInfo[playerid][pCarkey3] = i;
}
else if(PlayerInfo[playerid][pCarkey4] == SCRIPT_CARS)
{
PlayerInfo[playerid][pCarkey4] = i;
}
else if(PlayerInfo[playerid][pCarkey5] == SCRIPT_CARS)
{
PlayerInfo[playerid][pCarkey5] = i;
}
new string[250];
new sendername[MAX_PLAYER_NAME];
format(string, sizeof(string), ""COL_GREY"You have purchased a new Sparrow, for $7000000, type {FF6347}/v help"COL_GREY" for details.");
SendClientMessage(playerid,COLOR_GREY,string);
SendClientMessage(playerid,COLOR_GREY,""COL_GREY"You must set your Sparrow's spawn using {FF6347}/v setpark"COL_GREY" as soon as possible.");
SendClientMessage(playerid,COLOR_GREY,""COL_GREY"Los Santos Aircraft: We have parked your {FF6347}Sparrow"COL_GREY" at Los Santos Airport");
PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-7000000;
CarInfo[i][cOwnedCar] = 1;
CarInfo[i][cModel] = 469;
format(string, sizeof(string), "Sparrow");
strmid(CarInfo[i][cDescription], string, 0, strlen(string), 255);
CarInfo[i][cValue] = 7000000;
CarInfo[i][cColorOne] = 13;
CarInfo[i][cColorTwo] = 13;
CarInfo[i][cLock] = 0;
CarInfo[i][cLocationx] = 1993.2000;
CarInfo[i][cLocationy] = -2382.3000;
CarInfo[i][cLocationz] = 14.5000;
CarInfo[i][cAngle] = 90.00;
CarInfo[i][cDonate] = 0;
CarInfo[i][cTrunkWep][1] = 0;
CarInfo[i][cTrunkWep][2] = 0;
CarInfo[i][cTrunkWep][3] = 0;
CarInfo[i][cTrunkWep][4] = 0;
CarInfo[i][cTrunkAmmo][1] = 0;
CarInfo[i][cTrunkAmmo][2] = 0;
CarInfo[i][cTrunkAmmo][3] = 0;
CarInfo[i][cTrunkAmmo][4] = 0;
CarInfo[i][cTrunkArmour] = 0.0;
CarInfo[i][cTrunkCounter] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s", sendername);
strmid(CarInfo[i][cOwner], string, 0, strlen(string), 255);
new carid = AddStaticVehicleEx(CarInfo[i][cModel],CarInfo[i][cLocationx],CarInfo[i][cLocationy],CarInfo[i][cLocationz]+1,CarInfo[i][cAngle],CarInfo[i][cColorOne],CarInfo[i][cColorTwo],3600);
VehicleOwned[carid] = i;
UpdateAccount(playerid);
SaveCars();
return 1;
}
}
}
}
if(modelid == 2 && PlayerInfo[playerid][pAccount] > 9999999) // Shamal
{
new found = 0;
for(new i = 0; i < sizeof(CarInfo); i++)
{
if(found != 1)
{
if(CarInfo[i][cOwnedCar] == 0)
{
found = 1;
CarInfo[i][cMod][0] = 0;
CarInfo[i][cMod][1] = 0;
CarInfo[i][cMod][2] = 0;
CarInfo[i][cMod][3] = 0;
CarInfo[i][cMod][4] = 0;
CarInfo[i][cMod][5] = 0;
CarInfo[i][cMod][6] = 0;
CarInfo[i][cMod][7] = 0;
CarInfo[i][cMod][8] = 0;
CarInfo[i][cMod][9] = 0;
if(PlayerInfo[playerid][pCarkey] == SCRIPT_CARS)
{
PlayerInfo[playerid][pCarkey] = i;
}
else if(PlayerInfo[playerid][pCarkey2] == SCRIPT_CARS)
{
PlayerInfo[playerid][pCarkey2] = i;
}
else if(PlayerInfo[playerid][pCarkey3] == SCRIPT_CARS)
{
PlayerInfo[playerid][pCarkey3] = i;
}
else if(PlayerInfo[playerid][pCarkey4] == SCRIPT_CARS)
{
PlayerInfo[playerid][pCarkey4] = i;
}
else if(PlayerInfo[playerid][pCarkey5] == SCRIPT_CARS)
{
PlayerInfo[playerid][pCarkey5] = i;
}
new string[250];
new sendername[MAX_PLAYER_NAME];
format(string, sizeof(string), ""COL_GREY"You have purchased a new Shamal, for $10000000, type {FF6347}/v help"COL_GREY" for details.");
SendClientMessage(playerid,COLOR_GREY,string);
SendClientMessage(playerid,COLOR_GREY,""COL_GREY"You must set your Shamal's spawn using {FF6347}/v setpark"COL_GREY" as soon as possible.");
SendClientMessage(playerid,COLOR_GREY,""COL_GREY"Los Santos Aircraft: We have parked your {FF6347}Shamal"COL_GREY" at Los Santos Airport");
PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-10000000;
CarInfo[i][cOwnedCar] = 1;
CarInfo[i][cModel] = 519;
format(string, sizeof(string), "Shamal");
strmid(CarInfo[i][cDescription], string, 0, strlen(string), 255);
CarInfo[i][cValue] = 10000000;
CarInfo[i][cColorOne] = 13;
CarInfo[i][cColorTwo] = 13;
CarInfo[i][cLock] = 0;
CarInfo[i][cLocationx] = 1993.2000;
CarInfo[i][cLocationy] = -2382.3000;
CarInfo[i][cLocationz] = 14.5000;
CarInfo[i][cAngle] = 90.00;
CarInfo[i][cDonate] = 0;
CarInfo[i][cTrunkWep][1] = 0;
CarInfo[i][cTrunkWep][2] = 0;
CarInfo[i][cTrunkWep][3] = 0;
CarInfo[i][cTrunkWep][4] = 0;
CarInfo[i][cTrunkAmmo][1] = 0;
CarInfo[i][cTrunkAmmo][2] = 0;
CarInfo[i][cTrunkAmmo][3] = 0;
CarInfo[i][cTrunkAmmo][4] = 0;
CarInfo[i][cTrunkArmour] = 0.0;
CarInfo[i][cTrunkCounter] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s", sendername);
strmid(CarInfo[i][cOwner], string, 0, strlen(string), 255);
new carid = AddStaticVehicleEx(CarInfo[i][cModel],CarInfo[i][cLocationx],CarInfo[i][cLocationy],CarInfo[i][cLocationz]+1,CarInfo[i][cAngle],CarInfo[i][cColorOne],CarInfo[i][cColorTwo],3600);
VehicleOwned[carid] = i;
UpdateAccount(playerid);
SaveCars();
return 1;
}
}
}
}
}
else SendClientMessage(playerid, COLOR_GREY, "You can not afford this plane (money gets transferred from your bank).");
return 1;
}
return 1;
}