SA-MP Forums Archive
whats wrong . - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: whats wrong . (/showthread.php?tid=271324)



whats wrong . - [bs]_lancer - 23.07.2011

i have this cmd for /sellbus but the prob is .. i can sell any bus in the game

lets say i own "sex shop" biz and my friend own "4D" biz. if i went to his biz and did /sellbus i cant cuz i already have no biz. but if i bought biz and went to my friend biz then i can sell it . i hope u guys got that i mean.

here the cmd ( i think the prob with it not with another stuff )

pawn Код:
dcmd_sellbus(playerid,params[])
{
    #pragma unused params
 if(DoesPlayerOwnBusiness(playerid) == 0) return SendClientMessage(playerid,COLOUR_RED,"You do not own any business");
    else
    {
        if(IsPlayerInRangeOfOwnedBusiness(playerid) != -1)
        {
            new biz[50],pname[MAX_PLAYER_NAME];
            new b = IsPlayerInRangeOfOwnedBusiness(playerid);
            new string[128];
            new name[MAX_STRING];
            format(biz,sizeof(biz),"%iBusinessname",b);
            name = dini_Get("business.ini",biz);
            format(string,sizeof(string),"You have sold %s",name);
            SendClientMessage(playerid,COLOUR_YELLOW,string);
            OwnsBusiness[playerid] = 0;
            format(biz,sizeof(biz),"%iOwner",b);
            dini_IntSet("business.ini",biz,0);
            format(biz,sizeof(biz),"%iCost",b);
            new cash = dini_Int("Business.ini",biz);
            GivePlayerMoney(playerid,cash);
            OwnsBusiness[playerid] = 0;
            GetPlayerName(playerid,pname,sizeof(pname));
            dini_IntSet("Business.ini",pname,0);
            }
        else return SendClientMessage(playerid,COLOUR_RED,"You are not in range of your business!");
        }
    return 1;
}
i can show u the whole script if u want. every thing is working great except this i rly need it done! ty ^


Re: whats wrong . - Mean - 23.07.2011

I didn't get your point (and so probably no one will). Elaborate more.


Re: whats wrong . - [bs]_lancer - 24.07.2011

k here ..

this script is buiness system with 3 simple commands. /buybus /sellbus and /getprofit so .. every thing is working great except /sellbus command! i can sell any biz i want even if i wasnt the owner. but to sell i have to be owner of one. if i own an biz then i can sell any one not just mine but if i dont own one then i cant cuz i will have this msg "u dont have any biz to own"

got me now bro ?


Re: whats wrong . - Mean - 24.07.2011

You've never put a check to see if the business you're selling is not yours.