14.08.2018, 01:14
The problem in the command is when i make a /bizexit for any businesses interior doesn't working fine.
- When i enter a biz i will falling.
What's the problem in this command?
Here is the /bizexit also.
- When i enter a biz i will falling.
What's the problem in this command?
Here is the /bizexit also.
pawn Код:
CMD:enter(playerid, params[])
{
for(new i = 1; i < MAX_BIZ; i++)
{
if (IsPlayerInRangeOfPoint(playerid, 1.0, biz_info[i][biz_pos_entrance][0], biz_info[i][biz_pos_entrance][1], biz_info[i][biz_pos_entrance][2]) &&
biz_info[i][biz_pos_exit][0] != -1)
{
if (biz_info[i][biz_lock])
return SCM(playerid, -1, "The business is closed.");
if (GetPlayerMoney(playerid) < biz_info[i][biz_fee])
return SCM(playerid, -1, "You don't have enough money to enter this business.");
GivePlayerMoney(playerid, -biz_info[i][biz_fee]);
if(biz_info[i][biz_type] == BIZ_TYPE_247)
{
playerInBiz[playerid] = biz_info[i][biz_type];
}
if(biz_info[i][biz_type] == BIZ_TYPE_CLOTHES)
{
playerInBiz[playerid] = biz_info[i][biz_type];
}
return SetPlayerPos(playerid, biz_info[i][biz_pos_exit][0], biz_info[i][biz_pos_exit][1], biz_info[i][biz_pos_exit][2]);
}
}
return 1;
}
CMD:bizexit(playerid, params[])
{
if (sscanf(params, "i", params[0]))
return SCM(playerid, -1, "/bizexit [business-id]");
if (biz_info[params[0]][biz_id] != -1)
return SCM(playerid, -1, "Invalid business id.");
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
biz_info[params[0]][biz_pos_exit][0] = x;
biz_info[params[0]][biz_pos_exit][1] = y;
biz_info[params[0]][biz_pos_exit][2] = z;
SaveBiz(biz_info[params[0]][biz_id]);
SendInfo(playerid, "You have updated the business exit.");
return 1;
}