Updating label - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Updating label (
/showthread.php?tid=634159)
Updating label -
Despacito - 14.05.2017
I have a gangzone system which creates a label showing zone name and which team owns it (Ex: Area69 - Owned by Usa).
pawn Код:
new label[100];
format(label, sizeof(label), "ZONE: %i - %s \nOwned by: %s", i, gCaptureZone[i][zone_Name], gTeamData[gCaptureZone[i][zone_Owner]][team_Name]);
CreateDynamic3DTextLabel(label, COLOR_GOLD, gCaptureZone[i][zone_CP][0], gCaptureZone[i][zone_CP][1], gCaptureZone[i][zone_CP][2], 50.0);
The label works, but i want to update text "owned by" after a player captured that zone from another team.
If im from team russia and i capture that zone, it should update the label with "zone area69 owned by russia"
How to make it with UpdateDynamic3dTextLabel? Thanks.
Re: Updating label -
Toroi - 14.05.2017
Код:
UpdateDynamic3DTextLabelText(STREAMER_TAG_3D_TEXT_LABELid, color, const text[]``)
Put that function in the part of your system where the players capture the zone so it triggers when it happens. All you have to do is to change the
gTeamData[gCaptureZone[i][zone_Owner]][team_Name] string to the name of the group the players capturing are in.
Re: Updating label -
Despacito - 14.05.2017
Can you make me an example?
Re: Updating label -
Despacito - 15.05.2017
Bump
Re: Updating label -
zedshadowzw - 15.05.2017
Did you make that?
Or you use somebody else's
Re: Updating label -
Despacito - 15.05.2017
What
Re: Updating label -
iLearner - 15.05.2017
Quote:
Originally Posted by zedshadowzw
Did you make that?
Or you use somebody else's
|
PHP код:
//create label
new label[100], Text3D:mylabel;
format(label, sizeof(label), "ZONE: %i - %s \nOwned by: %s", i, gCaptureZone[i][zone_Name], gTeamData[gCaptureZone[i][zone_Owner]][team_Name]);
mylabel = CreateDynamic3DTextLabel(label, COLOR_GOLD, gCaptureZone[i][zone_CP][0], gCaptureZone[i][zone_CP][1], gCaptureZone[i][zone_CP][2], 50.0);
// update it
UpdateDynamic3DTextLabelText(mylabel, COLOR_GOLD, "here goes my updated text");