Noticias:

Debes de estar registrado para poder ver el contenido indicado. Registrate o Conectate

Menú Principal

Sistema de venta 24/7 en dialogos

Iniciado por Swarlog, Feb 04, 2023, 12:48 AM

Tema anterior - Siguiente tema

Swarlog

Información Adicional:

Básicamente es lo que dice el titulo del post, se trata del dialogo de compra en las tiendas 24/7 mediante el comando "/buy". Muy bueno para editarlo y ponerlo al gusto de cada uno.

Código:

OnPlayerCommandText:

if(strcmp(cmdtext,"/buy",true)==0)
 if(IsPlayerInRangeOfPoint(playerid, 10.0, -30.8246,-28.4104,1003.5573))
{
    ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Shop List","$15 - Condoms\n$5 - Chips\n$5 - Cola\n$3 - Burger\n$500 - Civilian Vest\n$100 - Camera\n$50 - Baseball Bat\n$50 - Wooden Cane\","Purchase","Exit");
       return 1;
}

OnDialogResponse:

if(dialogid==1 && response==1)
if(dialogid==1 && response==1)
{

switch(listitem)
    {
        case 0:
        {
        if(GetPlayerMoney(playerid) <15) return SendClientMessage(playerid,0xAA3333AA, "You do not have enough money!");
        new Float:pArmour;
        GetPlayerArmour(playerid, Float:pArmour);
        SendClientMessage(playerid,0xFF9900AA,"You have bought condoms for $15!");
        GivePlayerMoney(playerid, -15);
        SetPlayerArmour(playerid, pArmour+5);
            }
        case 1:
        {
        if(GetPlayerMoney(playerid) <9) return SendClientMessage(playerid,0xAA3333AA, "You do not have enough money!");
        SendClientMessage(playerid, 0xD6D6D6AA, "You purchased a bag of chips for $5");
        GivePlayerMoney(playerid, -9);
        ApplyAnimation(playerid,"VENDING", "vend_eat1_P",4.1,0,1,1,1,1,1);
        }
        case 2:
        {
        if(GetPlayerMoney(playerid) <3) return SendClientMessage(playerid,0xAA3333AA, "You do not have enough money!");
        new Float:pHealth;
        GetPlayerHealth(playerid, Float:pHealth);
        SendClientMessage(playerid, 0xD6D6D6AA, "You purchased a can of cola for $3");
        GivePlayerMoney(playerid, -3);
        SetPlayerHealth(playerid, pHealth+10);
        }
        case 3:
        {
        if(GetPlayerMoney(playerid) <3) return SendClientMessage(playerid,0xAA3333AA, "You do not have enough money!");
        new Float:pArmour;
        GetPlayerArmour(playerid, Float:pArmour);
        SendClientMessage(playerid, 0xD6D6D6AA, "You purchased a burger for $3");
        SetPlayerAttachedObject(playerid, 4, 2880, 5);
        GivePlayerMoney(playerid, -3);
        ApplyAnimation(playerid,"VENDING", "vend_eat1_P",4.1,0,1,1,1,1,1);
        SetPlayerArmour(playerid, pArmour+3);
        SendClientMessage(playerid, 0xD6D6D6AA, "((Use {219900}/removeobjects{D6D6D6} to remove the object!))");
        }
        case 4:
        {
        if(GetPlayerMoney(playerid) <500) return SendClientMessage(playerid,0xAA3333AA, "You do not have enough money!");
        new Float:pArmour;
        GetPlayerArmour(playerid, Float:pArmour);
        SendClientMessage(playerid, 0xD6D6D6AA, "You purchased a Civilian vest for $500");
        GivePlayerMoney(playerid, -500);
        SetPlayerArmour(playerid, pArmour+50);
        }
        case 5:
        {
        if(GetPlayerMoney(playerid) <100) return SendClientMessage(playerid,0xAA3333AA, "You do not have enough money!");
        new Float:pArmour;
        GetPlayerArmour(playerid, Float:pArmour);
        SendClientMessage(playerid, 0xD6D6D6AA, "You purchased a {13D4A3}Camera{D6D6D6} for $100");
        GivePlayerMoney(playerid, -125);
        GivePlayerWeapon(playerid, 43, 100);
        }
        case 6:
        {
        if(GetPlayerMoney(playerid) <35) return SendClientMessage(playerid,0xAA3333AA, "You do not have enough money!");
        new Float:pArmour;
        GetPlayerArmour(playerid, Float:pArmour);
        SendClientMessage(playerid, 0xD6D6D6AA, "You purchased a {13D4A3}Baseball Bat{D6D6D6} for $50");
        GivePlayerMoney(playerid, -50);
        GivePlayerWeapon(playerid, 5, 0);
        }
        case 7:
        {
        if(GetPlayerMoney(playerid) <50) return SendClientMessage(playerid,0xAA3333AA, "You do not have enough money!");
        new Float:pArmour;
        GetPlayerArmour(playerid, Float:pArmour);
        SendClientMessage(playerid, 0xD6D6D6AA, "You purchased a {13D4A3}Wooden Cane{D6D6D6} for $50");
        GivePlayerMoney(playerid, -50);
        GivePlayerWeapon(playerid, 15, 0);
        }