pawn Код:
// onplayerenterdynamiccp
if(checkpointid == rsrobcp)
{
ShowPlayerDialog(playerid,9403,DIALOG_STYLE_LIST,"Purchase Items...","1. Beer ($500)\n2. Wine ($1000)\n3. Drugs (50g/$15,000)\n4. "#COL_RED"Casino Robbery","Purchase","Cancel");
}
// ondialogresponse
if(dialogid == 9403)
{
if(response)
{
switch(listitem)
{
case 0:
{
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Beer Purchased For $500. Don't Drink And Drive!");
//SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_BEER);
GivePlayerMoney(playerid,-500);
new Float: rhealth;
GetPlayerHealth(playerid,rhealth);
SetPlayerHealth(playerid,rhealth+15);
new rand = random(15);
if(rand >= 0 && rand <=10)
{
SetPlayerDrunkLevel(playerid,3000);
ApplyAnimation(playerid, "BAR", "dnk_stndM_loop", 3.0,0,0,0,0,0,0);
//SendClientMessage(playerid,red,"You Are A Little Tipsy. Drinking More May Result In Death!");
}
if(rand >=11 && rand <= 15)
{
new name[24],string[128];
GetPlayerName(playerid,name,24);
format(string,128,"%s (%d) Has Died From Alcohol Poisoning.",name,playerid);
SendClientMessageToAll(COLOR_BROWN,string);
GameTextForPlayer(playerid,"~r~died from ~n~alcohol poisoning",5000,3);
SetPlayerHealth(playerid,0);
SetPVarInt(playerid,"Alive",0);
SendDeathMessage(INVALID_PLAYER_ID,playerid,47);
if(GetPVarInt(playerid,"Alive") == 0)
{
SetPlayerColor(playerid,grey);
}
}
ShowPlayerDialog(playerid,9403,DIALOG_STYLE_LIST,"Purchase Items...","1. Beer ($500)\n2. Wine ($1000)\n3. Drugs (50g/$15,000)\n4. "#COL_RED"Casino Robbery","Purchase","Cancel");
}
case 1:
{
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Wine Purchased For $1,000. Don't Drink And Drive!");
//SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_WINE);
GivePlayerMoney(playerid,-1000);
new Float: rhealth;
GetPlayerHealth(playerid,rhealth);
SetPlayerHealth(playerid,rhealth+30);
new rand = random(15);
if(rand >= 0 && rand <=10)
{
SetPlayerDrunkLevel(playerid,3000);
ApplyAnimation(playerid, "BAR", "dnk_stndM_loop", 3.0,0,0,0,0,0,0);
//SendClientMessage(playerid,red,"You Are A Little Tipsy. Drinking More May Result In Death!");
}
if(rand >=11 && rand <= 15)
{
new name[24],string[128];
GetPlayerName(playerid,name,24);
format(string,128,"%s (%d) Has Died From Alcohol Poisoning.",name,playerid);
SendClientMessageToAll(COLOR_BROWN,string);
GameTextForPlayer(playerid,"~r~died from ~n~alcohol poisoning",5000,3);
SetPlayerHealth(playerid,0);
SetPVarInt(playerid,"Alive",0);
SendDeathMessage(INVALID_PLAYER_ID,playerid,47);
if(GetPVarInt(playerid,"Alive") == 0)
{
SetPlayerColor(playerid,grey);
}
}
ShowPlayerDialog(playerid,9403,DIALOG_STYLE_LIST,"Purchase Items...","1. Beer ($500)\n2. Wine ($1000)\n3. Drugs (50g/$15,000)\n4. "#COL_RED"Casino Robbery","Purchase","Cancel");
}
case 2:
{
ShowPlayerDialog(playerid,5,DIALOG_STYLE_LIST,"Purchase Drugs...","1. 50 Grams ($15,000)","Purchase","Cancel");
}
case 3:
{
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Casino Robbery Coming Soon!");
}
}
}
}