[Pomoc] Dijalog

Započeo Mauricije
1. Dec. 2012. Zaključano
548
pregleda
4
postova
Taco
5
Underboss
1. Dec. 2012.
Skripta koju koristim:zGaming
Detaljan opis problema:Trebam kupovinu u marketu stavit u dijalog
Dio skripte:
CMD:buy(playerid, params[])
{
new idx = GetPlayerVirtualWorld(playerid)-100, string, type, price;
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(idx > 0 && idx < MAX_BIZ && BizInfo != 1 && BizInfo != 2 && BizInfo != 3 && BizInfo != 4 && BizInfo != 6 || idx < 1 || idx > MAX_BIZ) return SendClientMessage(playerid, COLOR_GREY, "You are not inside a business.");
if(BizInfo == 1)
{
if(sscanf(params, "s", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /buy ");
if(BizInfo < 1) return SendClientMessage(playerid, COLOR_GREY, "This business is currently out of products.");
if(!strcmp(params, "cellphone", true))
{
    if(PlayerInfo < 100) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to do this.");
    PlayerInfo = 1;
BizInfo += 100;
BizInfo --;
BizInfo ++;
GiveZaiatMoney(playerid, -100);
format(string, sizeof(string), "* %s has bought a cellphone for $100.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, " You can get a sim card from the Telecom Company.");
}
if(!strcmp(params, "phonebook", true))
{
    if(PlayerInfo < 50) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to do this.");
    PlayerInfo = 1;
    BizInfo += 50;
    BizInfo --;
    BizInfo ++;
GiveZaiatMoney(playerid, -50);
format(string, sizeof(string), "* %s has bought an electronic phonebook for $50.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, " You can use /phonebook to find someone's number.");
}
if(!strcmp(params, "dice", true))
{
    if(PlayerInfo < 20) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to do this.");
    PlayerInfo = 1;
    BizInfo += 20;
    BizInfo --;
    BizInfo ++;
GiveZaiatMoney(playerid, -20);
format(string, sizeof(string), "* %s has bought a pair of special dice for $20.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, " You can use /rolldice to roll a dice.");
}
if(!strcmp(params, "cigar", true))
{
    if(PlayerInfo < 100) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to do this.");
    PlayerInfo = 5;
    BizInfo += 100;
    BizInfo --;
    BizInfo ++;
GiveZaiatMoney(playerid, -100);
format(string, sizeof(string), "* %s has bought 5 cuban cigars for $100.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, " You can use /smoke to smoke a cigar.");
}
// Level 2: Speedometer | Sprunk | Spraycan | Rope
if(!strcmp(params, "speedometer", true))
{
    if(BizInfo < 2) return SendClientMessage(playerid, COLOR_GREY, "This 24/7 Market doesn't have this product yet.");
if(PlayerInfo < 200) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to do this.");
    PlayerInfo = 1;
    BizInfo += 200;
    BizInfo --;
    BizInfo ++;
GiveZaiatMoney(playerid, -200);
format(string, sizeof(string), "* %s has bought a speedometer for $200.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, " You can use /tog to toggle speedometer on/off.");
}
if(!strcmp(params, "sprunk", true))
{
    if(BizInfo < 2) return SendClientMessage(playerid, COLOR_GREY, "This 24/7 Market doesn't have this product yet.");
        if(PlayerInfo < 30) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to do this.");
    PlayerInfo = 5;
    BizInfo += 30;
    BizInfo --;
    BizInfo ++;
GiveZaiatMoney(playerid, -30);
format(string, sizeof(string), "* %s has bought 5 redbull cans for $30.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, " You can use /sprunk to drink a sprunk can.");
}
if(!strcmp(params, "spraycan", true))
{
    if(BizInfo < 2) return SendClientMessage(playerid, COLOR_GREY, "This 24/7 Market doesn't have this product yet.");
        if(PlayerInfo < 100) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to do this.");
    PlayerInfo = 10;
    BizInfo += 100;
    BizInfo --;
    BizInfo ++;
GiveZaiatMoney(playerid, -100);
format(string, sizeof(string), "* %s has bought a duko spraycan $100.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, " You can use /colorcar & /paintcar to color/paint a car.");
}
if(!strcmp(params, "rope", true))
{
    if(BizInfo < 2) return SendClientMessage(playerid, COLOR_GREY, "This 24/7 Market doesn't have this product yet.");
        if(PlayerInfo < 60) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to do this.");
    PlayerInfo = 5;
    BizInfo += 60;
    BizInfo --;
    BizInfo ++;
GiveZaiatMoney(playerid, -60);
format(string, sizeof(string), "* %s has bought 5 strong ropes for $60.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, " You can use /tie to tie someone.");
}
if(!strcmp(params, "blindfold", true))
{
    if(BizInfo < 3) return SendClientMessage(playerid, COLOR_GREY, "This 24/7 Market doesn't have this product yet.");
    if(PlayerInfo < 60) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to do this.");
    PlayerInfo = 5;
    BizInfo += 60;
    BizInfo --;
    BizInfo ++;
GiveZaiatMoney(playerid, -60);
format(string, sizeof(string), "* %s has bought 5 blindfolds for $600.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, " You can use /blindfold to blindfold someone.");
}
if(!strcmp(params, "walkietalkie", true))
{
    if(BizInfo < 3) return SendClientMessage(playerid, COLOR_GREY, "This 24/7 Market doesn't have this product yet.");
        if(PlayerInfo < 200) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to do this.");
    PlayerInfo = 1;
    BizInfo += 200;
    BizInfo --;
    BizInfo ++;
GiveZaiatMoney(playerid, -200);
format(string, sizeof(string), "* %s has bought a WalkieTalkie for $200.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, " You can use /wtc to adjust the WalkieTalkie's channel, /wt to talk on it.");
}
if(!strcmp(params, "smartphone", true))
{
    if(BizInfo < 3) return SendClientMessage(playerid, COLOR_GREY, "This 24/7 Market doesn't have this product yet.");
        if(PlayerInfo < 500) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to do this.");
    PlayerInfo = 2;
    BizInfo += 500;
    BizInfo --;
    BizInfo ++;
GiveZaiatMoney(playerid, -500);
format(string, sizeof(string), "* %s has bought a smartphone for $500.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, " You can use /smartphone to view your new cellphone commands.");
            // Level 4: Camera | Gas
}
if(!strcmp(params, "camera", true))
{
    if(BizInfo < 4) return SendClientMessage(playerid, COLOR_GREY, "This 24/7 Market doesn't have this product yet.");
        if(PlayerInfo < 300) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to do this.");
GiveZaiatWeapon(playerid, 43, 999999);
    BizInfo += 300;
    BizInfo --;
    BizInfo ++;
GiveZaiatMoney(playerid, -300);
format(string, sizeof(string), "* %s has bought a professional camera for $300.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, " You can start taking photos using your camera.");
}
if(!strcmp(params, "gascan", true))
{
    if(BizInfo < 2) return SendClientMessage(playerid, COLOR_GREY, "This 24/7 Market doesn't have this product yet.");
        if(PlayerInfo < 100) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to do this.");
    PlayerInfo = 1;
    BizInfo += 100;
    BizInfo --;
    BizInfo ++;
GiveZaiatMoney(playerid, -100);
format(string, sizeof(string), "* %s has bought a gas can for $100.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, " You can use /gascan inside a vehicle anywhere now.");
}

Neke slike/video za lakse dobivanje pomoci(neobavezno):
Blaeks_Biofor
5
Forum Don
1. Dec. 2012.
pa samo uradi dialog i onda pod ondialogresponse zavrsi...
Taco
5
Underboss
1. Dec. 2012.
Blaeks wrote on December 1, 2012, 8:57 am:
pa samo uradi dialog i onda pod ondialogresponse zavrsi...
Eh kad bi znao..
Blaeks_Biofor
5
Forum Don
1. Dec. 2012.
pa brate, ides na ovaj fazon , ovako nekako
CMD:buy(playerid, params[[)
{
    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "sta zelite kupiti?", "tvoje1\ntvoje2\ntvoje3", "Kupi", "Ne");
    return 1;
}
i onda pod ondialogresponse ovako nesto napravis
if(response)
    {
    switch(dialogid)
        {
case 1:
        {
          switch(listitem)
        {
            case 0:
            {
                if(GetPlayerMoney(playerid) < 1) return SCM(playerid, 0xFFFFFF, "nemate para");
                GivePlayerMoney(playerid, -1);
                SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
            }
            case 1:
            {
                if(GetPlayerMoney(playerid) < 2) return SCM(playerid, 0xFFFFFF, "nemate para.");
                GivePlayerMoney(playerid, -2);
                SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
            }
            case 2:
            {
                if(GetPlayerMoney(playerid) < 3) return SCM(playerid, 0xFFFFFF, "nemate para.");
                GivePlayerMoney(playerid, -3);
                SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
            }
        }
        }
}
    }
    return 1;
}
mada ja ti ovde nisam nista dodavao, ti sam dodajes na ovu foru, nadam se da razumes

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha