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):
