[Pomoc] /buybiz /sellbiz

Započeo Artieâ„¢
10. Feb. 2012. Zaključano
1,073
pregleda
7
postova
The Woozie
5
Kingpin
10. Feb. 2012.
Skripta koju koristim:Ravens RolePlay
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): /
nemanjatesic96
4
Shot Caller
11. Feb. 2012.
ja msm da vi ovako trebalo da radi
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 = 9999;
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;
}
Antonio_Marjanovic
3
Hustler
11. Feb. 2012.
probaj ovo:

 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 != 255)
{
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(PlayerToPoint(2.0, playerid, 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)
{
    Delete3DTextLabel(Text3D:sbizsale);
PlayerInfo = b+100;
SBizzInfo = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
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.");
Delete3DTextLabel(Text3D:sbizsale);
                        DateProp(playerid);
OnPropUpdate();
OnPlayerUpdate(playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You don't have the cash for that");
return 1;
}
}
}
nemanjatesic96
4
Shot Caller
11. Feb. 2012.
Quote from February 11, 2012, 9:48 am:
probaj ovo:

 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 != 255)
{
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(PlayerToPoint(2.0, playerid, 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)
{
    Delete3DTextLabel(Text3D:sbizsale);
PlayerInfo = b+100;
SBizzInfo = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
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.");
Delete3DTextLabel(Text3D:sbizsale);
                        DateProp(playerid);
OnPropUpdate();
OnPlayerUpdate(playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You don't have the cash for that");
return 1;
}
}
}

ja msm da ti to nece funkcionisati jer pogledaj njegove kodove on koristi           
if(PlayerInfo != 9999)
a ti si koristio
if(PlayerInfo != 255)
mogao bi tako nastati problem ako je on u celom gm koristio 9999
The Woozie
5
Kingpin
11. Feb. 2012.
nemanja ovo tvoje je pomoglo hvala ,ali imam drugi problem kako da stavim spawn money da odredjenu cifru a ne random,ja stavio ono setplayer Money na 500 $ ali ono opet random fura kad se svaki koristnik regustruje neki dobiju i po 2 miliona 😛 stavuci neki dio skripte ako treba
KombinatoR
5
Crime Lord
11. Feb. 2012.
â–º wrote on February 11, 2012, 8:39 pm:
nemanja ovo tvoje je pomoglo hvala ,ali imam drugi problem kako da stavim spawn money da odredjenu cifru a ne random,ja stavio ono setplayer Money na 500 $ ali ono opet random fura kad se svaki koristnik regustruje neki dobiju i po 2 miliona 😛 stavuci neki dio skripte ako treba

http://wiki.sa-mp.com/wiki/GivePlayerMoney
mozda ti to pomogne?
The Woozie
5
Kingpin
12. Feb. 2012.
nije pomoglo treba mi da znaci kad igrac se registruje i kad ga spawn da dobije odredjenu sumu novca npr 1000$ ja to stavbim u ono giveplayermoney ali isto kod da nisam radilo mi je kad sam imo GF a u ravensu nece ono samo svakom igracu daje razlicito novca pa nekima i po nekoliko miliona ali msm da je do regular ranka ili tako nesto nemogu rjesii nikako :/

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha