SA-MP Forums Archive
Command Help - 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)
+--- Thread: Command Help (/showthread.php?tid=447340)



Command Help - San1 - 29.06.2013

I belive this command is all messed up.. Can someone repair it and ill add +ReP?

pawn Код:
CMD:setentrancefee(playerid, params[])
{
    new bizid = BizIDS[playerid], string[128], string28[128];
    if(PlayerInfo[playerid][pBizKey] != INVALID_BIZZ_ID && (IsPlayerInRangeOfPoint(playerid, 2.0, BizInfo[PlayerInfo[playerid][pBizKey]][XCoord], BizInfo[PlayerInfo[playerid][pBizKey]][YCoord], BizInfo[PlayerInfo[playerid][pBizKey]][ZCoord]) || IsPlayerInRangeOfPoint(playerid, 2.0, BizInfo[PlayerInfo[playerid][pBizKey]][IXCoord], BizInfo[PlayerInfo[playerid][pBizKey]][IYCoord], BizInfo[PlayerInfo[playerid][pBizKey]][IZCoord])))
    {
        if(sscanf(params, "i", params[0])) return SendClientMessageEx(playerid, COLOR_GRAD3, "USAGE: /setentrancefee [fee]");
        BizInfo[PlayerInfo[playerid][pBizKey]][EntranceFee] = params[0];
        format(string,sizeof(string),"You have changed your Business Entrance Fee to %d", params);
        SendClientMessageEx(playerid, COLOR_GRAD3, string);
        SaveBizInfo(PlayerInfo[playerid][pBizKey]);
        Delete3DTextLabel(Text3D:BizLabel[PlayerInfo][playerid][pBizKey]);
        format(string28,sizeof(string28),"%s\nOwner: %s\nType: %s\nEntrance Fee: %d\nID: %d", BizInfo[pBizKey][Name], BizInfo[pBizKey][Owner],GetBizType([PlayerInfo][playerid][pBizKey]), BizInfo[pBizKey][EntranceFee], bizid);
        BizLabel[PlayerInfo[playerid][pBizKey] = Create3DTextLabel(string28, COLOR_BIZ, BizInfo[pBizKey][XCoord], BizInfo[pBizKey][YCoord], BizInfo[pBizKey][ZCoord], 10, 0, 0);
        return 1;
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GRAD2, "You don't own a business, or are not at one of them.");
        return 1;
    }
}