10.07.2013, 09:39
Works but its not updating the 3d Text Label - Please help..
pawn Код:
CMD:setentrancefee(playerid, params[])
{
new string28[128], string2[128], bizid;
for(new biz = 0; biz < MAX_BIZ; biz++)
{
if(IsPlayerInRangeOfPoint(playerid, 10, BizInfo[biz][IXCoord], BizInfo[biz][IYCoord], BizInfo[biz][IZCoord]))
{
if(GetPlayerVirtualWorld(playerid) == BizInfo[biz][VW])
{
if(!strcmp(BizInfo[biz][Owner], GetPlayerNameEx(playerid), true))
{
if(sscanf(params, "i", params[0])) return SendClientMessageEx(playerid, COLOR_GRAD3, "USAGE: /setentrancefee [fee]");
if(params[0] < 0 || params[0] > 50)
{
SendClientMessageEx(playerid, COLOR_GRAD1, "Entrance Fee can not be below 0 or above 50!");
return 1;
}
BizInfo[PlayerInfo[playerid][pBizKey]][EntranceFee] = params[0];
SaveBizInfo(PlayerInfo[playerid][pBizKey]);
format(string2,sizeof(string2),"You have changed your Business Entrance Fee to %d", params);
SendClientMessageEx(playerid, COLOR_GRAD3, string2);
Delete3DTextLabel(Text3D:BizLabel[bizid]);
format(string28,sizeof(string28),"%s\nOwner: %s\nType: %s\nEntrance Fee: %d\nID: %d", BizInfo[bizid][Name], BizInfo[bizid][Owner],GetBizType(bizid), BizInfo[bizid][EntranceFee], bizid);
BizLabel[bizid] = Create3DTextLabel(string28, COLOR_BIZ, BizInfo[bizid][XCoord], BizInfo[bizid][YCoord], BizInfo[bizid][ZCoord], 10, 0, 0);
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in your business.");
}
}
}
}
return 1;
}