30.10.2010, 04:01
Ok, i made it so all these 3Dlabels appear, but now when you type '/businessname' or '/sellbusiness' , it keeps the old 3Dlabel, plus adds the new, leaving 2 labels in place.
Here is where the labels first get created:
Here is the command:
Please help, thank you.
Here is where the labels first get created:
Код:
new buss1[128]; new buss2[128]; new buss3[128]; new Text3D:BIZ1; new Text3D:BIZ2; new Text3D:BIZ3;
Код:
for(new h = 0; h < sizeof(Businesses); h++) { if(IsPlayerInRangeOfPoint(i, 30, Businesses[h][bExteriorX], Businesses[h][bExteriorY], Businesses[h][bExteriorZ]) ) { if(GetPlayerVirtualWorld( i ) == 0 ) { if( strcmp(Businesses[h][bOwner], "Nobody", true) == 0 ) { if(Businesses[h][bPrice] == -1) { format(buss1,128, "Business ID: %d \n (%s) Unavailable", h, Businesses[h][bName]); BIZ1 = Create3DTextLabel( buss1 , ORANGE, Businesses[h][bExteriorX], Businesses[h][bExteriorY], Businesses[h][bExteriorZ], 20, 0 ); } else { format(buss2,128, "Business ID: %d \n (%s) \n Available to buy for %d (/buybusiness).", h, Businesses[h][bName], Businesses[h][bPrice]); BIZ2 = Create3DTextLabel( buss2 , ORANGE, Businesses[h][bExteriorX], Businesses[h][bExteriorY], Businesses[h][bExteriorZ], 20, 0 ); } } else { format(buss3,128, "Business ID: %d \n (%s) \n Owner: %s", h, Businesses[h][bName], Businesses[h][bOwner]); BIZ3 = Create3DTextLabel( buss3 , ORANGE, Businesses[h][bExteriorX], Businesses[h][bExteriorY], Businesses[h][bExteriorZ], 20, 0 ); } } } }
Код:
command(businessname, playerid, params[]) { new Name[255], string[ 128 ]; if( sscanf( params, "z", Name) ) { SendClientMessage( playerid, WHITE, "SYNTAX: /businessname [New Name]" ); } else { if(strlen(Name) >= 1 && strlen(Name) < 15) { if(strfind(Name, "~", true) ) { format( string, sizeof( string ), "You have changed your business name to %s.", Name); SendClientMessage( playerid, WHITE, string); SaveBusiness(Player[playerid][Business]); Update3DTextLabelText(Text3D:BIZ1, ORANGE, buss1); Update3DTextLabelText(Text3D:BIZ2, ORANGE, buss2); Update3DTextLabelText(Text3D:BIZ3, ORANGE, buss3); Businesses[Player[playerid][Business]][bName] = Name; } else { SendClientMessage( playerid, WHITE, "You may not use the '~' character." ); } } else { SendClientMessage( playerid, WHITE, "Names must be shorter than 15 characters, and higher than 1 character." ); } } return 1; }