Jump to content
  • 0

Bug /buybiz /sellbiz


Question

Posted

Am un bug la /buybiz cand cumpar un biz si vr sa il vand si dau /sellbiz zice ca nu detin un biz :| iar cand vreau sa cumpar un biz zice ca am deja un biz :|...

[pawn] 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[playerid][pPbiskey] != 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[sbEntranceX], SBizzInfo[sbEntranceY], SBizzInfo[sbEntranceZ]) && SBizzInfo[sbOwned] == 0)

{

if(PlayerInfo[playerid][pLevel] < SBizzInfo[sbLevelNeeded])

{

format(string, sizeof(string), "You Must Be Level %d To Purchase This",SBizzInfo[sbLevelNeeded]);

SendClientMessage(playerid, COLOR_GRAD5, string);

return 1;

}

if(GetPlayerMoney(playerid) > SBizzInfo[sbBuyPrice])

{

                        Delete3DTextLabel(Text3D:SBizzLabel);

PlayerInfo[playerid][pPbiskey] = b+100;

SBizzInfo[sbOwned] = 1;

GetPlayerName(playerid, sendername, sizeof(sendername));

strmid(SBizzInfo[sbOwner], sendername, 0, strlen(sendername), 255);

GivePlayerMoney(playerid,-SBizzInfo[sbBuyPrice]);

PlayerPlayMusic(playerid);

SendClientMessage(playerid, COLOR_WHITE, "Congratulations, On Your New Purchase.");

SendClientMessage(playerid, COLOR_WHITE, "Type /help to review the new business help section.");

SendClientMessage(playerid, COLOR_LIGHTRED, "ATENTIE: Daca vinzi biz-ul nu o sa primesti banii de la buy !");

                        DateProp(playerid);

OnPropUpdate();

OnPlayerUpdateEx(playerid);

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(PlayerToPoint(2.0, playerid, BizzInfo[bEntranceX], BizzInfo[bEntranceY], BizzInfo[bEntranceZ]) && BizzInfo[bOwned] == 0)

{

if(PlayerInfo[playerid][pLevel] < BizzInfo[bLevelNeeded])

{

format(string, sizeof(string), "You Must Be Level %d To Purchase This",BizzInfo[bLevelNeeded]);

SendClientMessage(playerid, COLOR_GRAD5, string);

return 1;

}

if(GetPlayerMoney(playerid) > BizzInfo[bBuyPrice])

{

PlayerInfo[playerid][pPbiskey] = b;

BizzInfo[bOwned] = 1;

GetPlayerName(playerid, sendername, sizeof(sendername));

strmid(BizzInfo[bOwner], sendername, 0, strlen(sendername), 255);

GivePlayerMoney(playerid,-BizzInfo[bBuyPrice]);

PlayerPlayMusic(playerid);

SetPlayerInterior(playerid,BizzInfo[bInterior]);

PlayerInfo[playerid][pInt] = BizzInfo[bInterior];

SetPlayerPos(playerid,BizzInfo[bExitX],BizzInfo[bExitY],BizzInfo[bExitZ]);

GameTextForPlayer(playerid, "~w~Welcome~n~You can exit at any time by moving to this door and typing /exit", 5000, 3);

PlayerInfo[playerid][pInt] = BizzInfo[bInterior];

PlayerInfo[playerid][pLocal] = b ;

SendClientMessage(playerid, COLOR_WHITE, "Congratulations, On Your New Purchase.");

SendClientMessage(playerid, COLOR_WHITE, "Type /help to review the new business help section.");

                        DateProp(playerid);

OnPropUpdate();

OnPlayerUpdateEx(playerid);

return 1;

}

else

{

SendClientMessage(playerid, COLOR_WHITE, "You don't have the cash for that");

return 1;

}

}

}

}

return 1;

}[/pawn]

Si

[pawn] if(strcmp(cmd, "/sellbiz", true) == 0)

{

    if(IsPlayerConnected(playerid))

{

GetPlayerName(playerid, playername, sizeof(playername));

if(PlayerInfo[playerid][pPbiskey] == 255)

{

SendClientMessage(playerid, COLOR_WHITE, "Nu deti un Bizz.");

return 1;

}

if(PlayerInfo[playerid][pMarried] > 0)

    {

        SendClientMessage(playerid, COLOR_GREY, "Esti Casatorit nu poti vinde Bizul");

        return 1;

    }

if(PlayerInfo[playerid][pPbiskey] >= 100 && strcmp(playername, SBizzInfo[PlayerInfo[playerid][pPbiskey]-100][sbOwner], true) == 0)

{

new bouse = PlayerInfo[playerid][pPbiskey]-100;

//GivePlayerMoney(playerid,SBizzInfo[bouse][sbTill]);

SBizzInfo[bouse][sbLocked] = 1;

SBizzInfo[bouse][sbOwned] = 0;

GetPlayerName(playerid, sendername, sizeof(sendername));

strmid(SBizzInfo[bouse][sbOwner], "The State", 0, strlen("The State"), 255);

strmid(SBizzInfo[bouse][sbExtortion], "No-one", 0, strlen("No-one"), 255);

ConsumingMoney[playerid] = 1;

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", SBizzInfo[bouse][sbTill]);

GameTextForPlayer(playerid, string, 10000, 3);

SBizzInfo[bouse][sbTill] = 0;

PlayerInfo[playerid][pPbiskey] = 255;

OnPropUpdate();

OnPlayerUpdateEx(playerid);

return 1;

}

if(strcmp(playername, BizzInfo[PlayerInfo[playerid][pPbiskey]][bOwner], true) == 0)

{

new bouse = PlayerInfo[playerid][pPbiskey];

BizzInfo[bouse][bLocked] = 1;

BizzInfo[bouse][bOwned] = 0;

GetPlayerName(playerid, sendername, sizeof(sendername));

strmid(BizzInfo[bouse][bOwner], "The State", 0, strlen("The State"), 255);

strmid(BizzInfo[bouse][bExtortion], "No-one", 0, strlen("No-one"), 255);

ConsumingMoney[playerid] = 1;

GivePlayerMoney(playerid,BizzInfo[bouse][bTill]);

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", BizzInfo[bouse][bTill]);

GameTextForPlayer(playerid, string, 10000, 3);

BizzInfo[bouse][bTill] = 0;

PlayerInfo[playerid][pPbiskey] = 255;

OnPropUpdate();

OnPlayerUpdateEx(playerid);

return 1;

}

else

{

SendClientMessage(playerid, COLOR_WHITE, "Nu deti un Bizz.");

}

}

return 1;

}[/pawn]

1 answer to this question

Recommended Posts

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.