Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == drinks && response) //
{
//
switch(listitem)
{
case 1:
{
if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -1);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
}
case 2:
{
if(GetPlayerMoney(playerid) < 2) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -2);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
}
case 3:
{
if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -3);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
}
}
return 1;
}
{
if(dialogid == license)
{
if(response)
{
if(listitem == 0)
{
if(GetPlayerMoney(playerid) < DRIVING_LICENSE_PRICE)
{
SendClientMessage(playerid,yellow," You don't have enough money.");
new dtests[] = "1\tDriving License - 800$\n2\tFlying License - 2000$\n3\tGun License - 1200$";
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Licenses, Chose One:",dtests,"Test","Exit");
}
else if(GetPlayerMoney(playerid) >= DRIVING_LICENSE_PRICE)
{
GivePlayerMoney(playerid,-DRIVING_LICENSE_PRICE);
SendClientMessage(playerid,yellow," Hint: Get a car from the park to start the test.");
PlayerInfo[playerid][DrivingTest] = 1;
}
}
else if(listitem == 1)
{
if(GetPlayerMoney(playerid) < FLYING_LICENSE_PRICE)
{
SendClientMessage(playerid,yellow," You don't have enough money.");
new dtests[] = "1\tDriving License - 800$\n2\tFlying License - 2000$\n3\tGun License - 1200$";
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Licenses, Chose One:",dtests,"Test","Exit");
}
else if(GetPlayerMoney(playerid) >= FLYING_LICENSE_PRICE)
{
GivePlayerMoney(playerid,-FLYING_LICENSE_PRICE);
SendClientMessage(playerid,yellow," Hint: Get a shamal from the San Fiero Airport to start the test.");
PlayerInfo[playerid][FlyingTest] = 1;
}
}
else if(listitem == 2)
{
if(GetPlayerMoney(playerid) < GUN_LICENSE_PRICE)
{
SendClientMessage(playerid,yellow," You don't have enough money.");
new dtests[] = "1\tDriving License - 800$\n2\tFlying License - 2000$\n3\tGun License - 1200$";
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Licenses, Chose One:",dtests,"Test","Exit");
}
else if(GetPlayerMoney(playerid) >= GUN_LICENSE_PRICE)
{
GivePlayerMoney(playerid,-FLYING_LICENSE_PRICE);
SendClientMessage(playerid,yellow," You have bought the gun license.Type /sl to show it!");
PlayerInfo[playerid][GunLicense] = 1;
}
}
}
}
return 1;
} }