Need help about this command
#5

Quote:
Originally Posted by Rapeassboi
Посмотреть сообщение
The guy above is wrong aswell.
So are you! You're trying to copy a string to another, using sscanf when params can be used and not to have to declare an array. You forgot to use a code block in the IsPlayerInRangeOfPoint statement and plus declaring variables when you don't use them (in case of an error message being displayed).

pawn Код:
CMD:setbname(playerid, params[])
{
    if (!PlayerInfo[playerid][pBiz] && !PlayerInfo[playerid][pVBiz]) return SendClientMessage(playerid, COLOR_GREY, "You don't own a business.");
    if (isnull(params)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /setbname <name>");
   
    new
        idx;
   
    if ((idx = PlayerInfo[playerid][pBiz]))
    {
        if (IsPlayerInRangeOfPoint(playerid, 2, BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ]))
        {
            new
                string[128];
           
            strcat((BizInfo[idx][bName][0] = '\0', BizInfo[idx][bName]), params, strlen(params));
            format(string, sizeof (string), "INFO: You have set your business name to '%s.'", params);
            SendClientMessageEx(playerid, COLOR_WHITE, string)
            Log("logs/business.log", string);
        }
    }
    return 1;
}
Reply


Messages In This Thread
Need help about this command - by NekoChan - 17.01.2014, 14:13
Re: Need help about this command - by Zamora - 17.01.2014, 14:17
Re: Need help about this command - by Rapeassboi - 17.01.2014, 14:25
Re: Need help about this command - by NekoChan - 17.01.2014, 14:40
Re: Need help about this command - by Konstantinos - 17.01.2014, 14:49

Forum Jump:


Users browsing this thread: 1 Guest(s)