Detaljan opis problema:Imam bug kada igrac kupi biznis sa /buybiz sve fino i tako proda sa /sellbiz i kada oce ne ki drugi kupiti na /buybiz pise da vec posjeduje biznis i da ga treba prodati i opet idem sellbiz ,pise da je prodan ali nikako da novi kupim 😛
Dio skripte:
Evo Buybiz i Sellbiz: (ako jos nesto treba recite )
if(strcmp(cmd, "/buybiz", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new Float:oldposx, Float:oldposy, Float:oldposz;
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
if(PlayerInfo != 9999)
{
SendClientMessage(playerid, COLOR_WHITE, " You already own a business, type /sellbiz if you want to buy this one.");
return 1;
}
for(new b = 0; b < sizeof(SBizzInfo); b++)
{
if(IsPlayerInRangeOfPoint(playerid, 2, SBizzInfo, SBizzInfo, SBizzInfo) && SBizzInfo == 0)
{
if(PlayerInfo < SBizzInfo)
{
format(string, sizeof(string), "You Must Be Level %d To Purchase This",SBizzInfo);
SendClientMessage(playerid, COLOR_GRAD5, string);
return 1;
}
if(GetPlayerMoney(playerid) > SBizzInfo)
{
if(PlayerInfo == 1)
{
PlayerInfo = b+100;
SBizzInfo = 1;
strmid(SBizzInfo, sendername, 0, strlen(sendername), 255);
SafeGivePlayerMoney(playerid,-SBizzInfo);
PlayerPlayMusic(playerid);
SendClientMessage(playerid, COLOR_WHITE, "Congratulations, On Your New Purchase.");
SendClientMessage(playerid, COLOR_WHITE, "Type /help to review the new business help section.");
OnPropUpdate(3,b);
OnPlayerUpdateEx(playerid);
OnPropTextdrawUpdate(3, b);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s -> /buybiz",d,m,y,h,mi,s,sendername);
CommandLog(string);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "* For security reasons, a passport is needed to buy a business!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You don't have the cash for that");
return 1;
}
}
}
for(new b = 0; b < sizeof(BizzInfo); b++)
{
if(IsPlayerInRangeOfPoint(playerid, 2, BizzInfo, BizzInfo, BizzInfo) && BizzInfo == 0)
{
if(PlayerInfo < BizzInfo)
{
format(string, sizeof(string), "You Must Be Level %d To Purchase This",BizzInfo);
SendClientMessage(playerid, COLOR_GRAD5, string);
return 1;
}
if(GetPlayerMoney(playerid) > BizzInfo)
{
PlayerInfo = b;
BizzInfo = 1;
strmid(BizzInfo, sendername, 0, strlen(sendername), 255);
SafeGivePlayerMoney(playerid,-BizzInfo);
PlayerPlayMusic(playerid);
SafeSetPlayerInterior(playerid,BizzInfo);
SetPlayerVirtualWorld(playerid,BizzInfo);
PlayerInfo = BizzInfo;
SafeSetPlayerPos(playerid,BizzInfo,BizzInfo,BizzInfo);
GameTextForPlayer(playerid, "~w~Welcome~n~You can exit at any time by moving to this door and typing /exit", 5000, 3);
PlayerInfo = b ;
SendClientMessage(playerid, COLOR_WHITE, "Congratulations, On Your New Purchase.");
SendClientMessage(playerid, COLOR_WHITE, "Type /help to review the new business help section.");
OnPropUpdate(2,b);
OnPlayerUpdateEx(playerid);
OnPropTextdrawUpdate(2, b);
BizzEntered = b;
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You don't have the cash for that");
return 1;
}
}
}
}
return 1;
}
if(strcmp(cmd, "/sellbiz", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, playername, sizeof(playername));
if(PlayerInfo == 9999)
{
SendClientMessage(playerid, COLOR_WHITE, "* You don't own a bizz.");
return 1;
}
if(PlayerInfo > 0)
{
SendClientMessage(playerid, COLOR_GREY, "* You are Married, can't sell the Bizz !");
return 1;
}
if(CanSellBizz == 0)
{
SendClientMessage(playerid, COLOR_GREY, "Nemozete prodati biznis bez dozvole /nalog!");
return 1;
}
if(PlayerInfo >= 100 && strcmp(playername, SBizzInfo[PlayerInfo-100], true) == 0)
{
new bouse = PlayerInfo-100;
SafeGivePlayerMoney(playerid,SBizzInfo);
SafeGivePlayerMoney(playerid,SBizzInfo);
SBizzInfo = 1;
SBizzInfo = 0;
strmid(SBizzInfo, "The State", 0, strlen("The State"), 255);
strmid(SBizzInfo, "No-one", 0, strlen("No-one"), 255);
//ConsumingMoney = 1;
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~Congratulations~n~ Prodali ste vas biznis za~n~~g~$%d + $%d", SBizzInfo, SBizzInfo);
GameTextForPlayer(playerid, string, 10000, 3);
SBizzInfo = 0;
PlayerInfo = 255;
OnPropUpdate(3,bouse);
OnPlayerUpdateEx(playerid);
OnPropTextdrawUpdate(3, bouse);
return 1;
}
if(strcmp(playername, BizzInfo[PlayerInfo], true) == 0)
{
new bouse = PlayerInfo;
BizzInfo = 1;
BizzInfo = 0;
strmid(BizzInfo, "The State", 0, strlen("The State"), 255);
strmid(BizzInfo, "No-one", 0, strlen("No-one"), 255);
//ConsumingMoney = 1;
SafeGivePlayerMoney(playerid,BizzInfo);
SafeGivePlayerMoney(playerid,BizzInfo);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~Congratulations~n~ You have sold your property for ~n~~g~$%d + $%d", BizzInfo, BizzInfo);
GameTextForPlayer(playerid, string, 10000, 3);
BizzInfo = 0;
PlayerInfo = 9999;
OnPropUpdate(2, bouse);
OnPlayerUpdateEx(playerid);
OnPropTextdrawUpdate(2, bouse);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You don't own a business.");
}
}
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s -> /sellbiz",d,m,y,h,mi,s,sendername);
CommandLog(string);
return 1;
}Neke slike/video za lakse dobivanje pomoci(neobavezno): /
