17.01.2014, 14:49
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;
}


