SA-MP Forums Archive
Changing ObjectMaterialText - 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: Changing ObjectMaterialText (/showthread.php?tid=651574)



Changing ObjectMaterialText - Rocket16 - 23.03.2018

new Ore3 = CreatePlayerObject(playerid, 19353, -1216.04895, 199.36223, 15.2079, 0.00000, 0.00000, -70.14004);
format(g_str, sizeof(g_str), "Reddite: $%d", SrvProp[svOre3]);
SetPlayerObjectMaterialText(playerid, Ore3, g_str, 0, 140, "Arial", 90, 1, 0xFFFFFFFF, 0, 1);

Basically my issue is that svOre3 updates every once in a while in the server and i'd like to have the Material Text update to reflect the new price, instead of just displaying the price it's spawned with.

How can I achieve this?


Re: Changing ObjectMaterialText - Matz - 23.03.2018

When svOre3 gets updated, put this code below related section

PHP код:
new g_str[32]; format(g_strsizeof(g_str), "Reddite: $%d"SrvProp[svOre3]);
SetPlayerObjectMaterialText(playeridOre3g_str0140"Arial"9010xFFFFFFFF01);