19.03.2014, 12:55
PHP код:
#include <a_samp>
#define FILTERSCRIPT
#include <zcmd>
CMD:veh(playerid, params[])
{
ShowPlayerDialog(playerid, 12, DIALOG_STYLE_LIST, "Vehicle Dealership", "Sultan\nNRG\nWashington\nElegy\nBuffalo", "Buy", "Cancel");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 12)
{
if(!response)
return 1;
switch(listitem)
{
case 0:
{
if(GetPlayerMoney(playerid) < 100000)
return SendClientMessage(playerid, 0, "You dont have enough funds!");
GivePlayerMoney(playerid, -100000);
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 1:
{
if(GetPlayerMoney(playerid) < 200000)
return SendClientMessage(playerid, 0, "You dont have enough funds!");
GivePlayerMoney(playerid, -200000);
new Float:p[4];
GetPlayerPos(playerid, p[0], p[1], p[2]);
GetPlayerFacingAngle(playerid, p[3]);
CreateVehicle(522, p[0], p[1], p[2], p[3]+90, -1, -1, 9999999);
}
case 2:
{
if(GetPlayerMoney(playerid) < 50000)
return SendClientMessage(playerid, 0, "You dont have enough funds!");
GivePlayerMoney(playerid, -50000);
new Float:p[4];
GetPlayerPos(playerid, p[0], p[1], p[2]);
GetPlayerFacingAngle(playerid, p[3]);
CreateVehicle(421, p[0], p[1], p[2], p[3]+90, -1, -1, 9999999);
}
case 3:
{
if(GetPlayerMoney(playerid) < 300000)
return SendClientMessage(playerid, 0, "You dont have enough funds!");
GivePlayerMoney(playerid, -300000);
new Float:p[4];
GetPlayerPos(playerid, p[0], p[1], p[2]);
GetPlayerFacingAngle(playerid, p[3]);
CreateVehicle(562, p[0], p[1], p[2], p[3]+90, -1, -1, 9999999);
}
case 4:
{
if(GetPlayerMoney(playerid) < 200000)
return SendClientMessage(playerid, 0, "You dont have enough funds!");
GivePlayerMoney(playerid, -200000);
new Float:p[4];
GetPlayerPos(playerid, p[0], p[1], p[2]);
GetPlayerFacingAngle(playerid, p[3]);
CreateVehicle(402, p[0], p[1], p[2], p[3]+90, -1, -1, 9999999);
}
}
}
return 1;
}
coomands are - /veh