22.07.2013, 22:05
The Dynamic Text Label for Owner - Which is a string it suppose to change "The State" over to "Player Name" - Its not Updating it at all
NO ERRORS ON COMPILE!
NO ERRORS ON COMPILE!
pawn Код:
CMD:buybiz(playerid, params[])
{
for(new biz = 0; biz < MAX_BIZ; biz++)
{
if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[biz][ex], BizInfo[biz][ey], BizInfo[biz][ez]))
{
if(PlayerInfo[playerid][BizID] == -1)
{
if(BizInfo[biz][Owned] == 0)
{
if(GetPlayerCash(playerid) >= BizInfo[biz][Price])
{
new string[128],string2[128], file[40];
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
BizInfo[biz][Owned] = 1;
format(file, sizeof(file), BPATH, biz);
new INI:File = INI_Open(file);
INI_WriteInt(File,"Owned", 1);
INI_WriteString(File,"Owner",GetPlayerNameEx(playerid));
INI_Close(File);
PlayerInfo[playerid][BizID] = biz;
GivePlayerCash(playerid, -BizInfo[biz][Price]);
format(string, sizeof(string),"You Have Bought Business ID (%d)", biz);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
DestroyDynamic3DTextLabel(Text3D:BizLabel[biz]);
format(string2,sizeof(string2),"Owner: "COL_WHITE"%s\n"COL_LBLUE"Biz Name: "COL_WHITE"%s\n"COL_BLUE"Type: "COL_WHITE"%d\n"COL_LIME"ID: "COL_WHITE"%d", BizInfo[biz][Owner], BizInfo[biz][Name], GetBizType(biz), biz);
BizLabel[biz] = CreateDynamic3DTextLabel(string2, COLOR_RED, BizInfo[biz][ex], BizInfo[biz][ey], BizInfo[biz][ez], 30.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, -1, -1, 30.0);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You don't have enough cash for this business");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "That business is already owned!");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You already own a Business.");
}
}
}
return 1;
}