02.04.2017, 20:23
hi
i want make saving vehicles
this my dealership but need save for player and load it with y_ini
+rep
i want make saving vehicles
this my dealership but need save for player and load it with y_ini
+rep
PHP код:
#include <zcmd>
CMD:buycar(playerid, params[])
{
ShowPlayerDialog(playerid, 13, DIALOG_STYLE_LIST, "Luxurious Car Dealership", "Bullet\nInfernus\nHotring\nStretch\nSultan\nSuper GT", "Buy", "Close");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 13)
{
if(!response)
return 1;
switch(listitem)
{
case 0:
{
if(GetPlayerMoney(playerid) < 25000)
return SendClientMessage(playerid, 0, "You don't have enough cash to buy this car!");
GivePlayerMoney(playerid, -25000);
new Float:p[4];
GetPlayerPos(playerid, p[0], p[1], p[2]);
GetPlayerFacingAngle(playerid, p[3]);
CreateVehicle(541, p[0], p[1], p[2], p[3]+90, -1, -1, 9999999);
}
case 1:
{
if(GetPlayerMoney(playerid) < 23000)
return SendClientMessage(playerid, 0, "You don't have enough cash to buy this car!");
GivePlayerMoney(playerid, -23000);
new Float:p[4];
GetPlayerPos(playerid, p[0], p[1], p[2]);
GetPlayerFacingAngle(playerid, p[3]);
CreateVehicle(411, p[0], p[1], p[2], p[3]+90, -1, -1, 9999999);
}
case 2:
{
if(GetPlayerMoney(playerid) < 20000)
return SendClientMessage(playerid, 0, "You don't have enough cash to buy this car!");
GivePlayerMoney(playerid, -20000);
new Float:p[4];
GetPlayerPos(playerid, p[0], p[1], p[2]);
GetPlayerFacingAngle(playerid, p[3]);
CreateVehicle(494, p[0], p[1], p[2], p[3]+90, -1, -1, 9999999);
}
case 3:
{
if(GetPlayerMoney(playerid) < 22000)
return SendClientMessage(playerid, 0, "You don't have enough cash to buy this car!");
GivePlayerMoney(playerid, -22000);
new Float:p[4];
GetPlayerPos(playerid, p[0], p[1], p[2]);
GetPlayerFacingAngle(playerid, p[3]);
CreateVehicle(409, p[0], p[1], p[2], p[3]+90, -1, -1, 9999999);
}
case 4:
{
if(GetPlayerMoney(playerid) < 17000)
return SendClientMessage(playerid, 0, "You don't have enough cash to buy this car!");
GivePlayerMoney(playerid, -17000);
new Float:p[4];
GetPlayerPos(playerid, p[0], p[1], p[2]);
GetPlayerFacingAngle(playerid, p[3]);
CreateVehicle(560, p[0], p[1], p[2], p[3]+90, -1, -1, 9999999);
}
case 5:
{
if(GetPlayerMoney(playerid) < 20000)
return SendClientMessage(playerid, 0, "You don't have enough cash to buy this car!");
GivePlayerMoney(playerid, -20000);
new Float:p[4];
GetPlayerPos(playerid, p[0], p[1], p[2]);
GetPlayerFacingAngle(playerid, p[3]);
CreateVehicle(506, p[0], p[1], p[2], p[3]+90, -1, -1, 9999999);
}
}
}
return 1;
}