Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if defined _r3mt_included
- #endinput
- #endif
- #define _r3mt_included
- #define MAX_MOVINGTEXT 100
- new Text3D:mtexts[MAX_MOVINGTEXT], rmtid, rmtcolor[sizeof(mtexts)], rmstring1[256][sizeof(mtexts)], texton3dtext[256][sizeof(mtexts)], rmtimer[sizeof(mtexts)];
- /*
- native CreateMoveable3DText(string[], speed, color, Float:distance, Float:x, Float:y, Float:z, virtualworld = -1, testLOS = 0);
- native DeleteMoveable3DTextLabel(textid);
- native AttachMoveable3DTextToVehicle(textid, vehid, Float:offsetx = 0.0, Float:offsety = 0.0, Float:offsetz = 0.0);
- native AttachMoveable3DTextToPlayer(textid, playerid, Float:offsetx = 0.0, Float:offsety = 0.0, Float:offsetz = 0.0);
- native UpdateMoveable3DTextLabelText(textid, string[], color, speed = 1);
- */
- stock CreateMoveable3DText(string[], speed, color, Float:distance, Float:x, Float:y, Float:z, virtualworld = -1, testLOS = 0)
- {
- if(rmtid < sizeof(mtexts))
- {
- rmtid++;
- rmtcolor[rmtid] = color;
- format(texton3dtext[rmtid], sizeof(texton3dtext), "%s ", string);
- mtexts[rmtid] = Create3DTextLabel(texton3dtext[rmtid], rmtcolor[rmtid], x,y,z, distance, virtualworld, testLOS);
- rmtimer[rmtid] = SetTimerEx("Move3DText", speed*100, true, "i",rmtid);
- return rmtid;
- } else {
- return printf("[RaFaeL] (Warning) Maximum of moving text is: %d", MAX_MOVINGTEXT);
- }
- }
- stock DeleteMoveable3DTextLabel(textid)
- {
- if(textid > rmtid) return printf("[RaFaeL] (Error) Invalid textid: %d", textid);
- format(texton3dtext[textid], sizeof(texton3dtext), " ");
- KillTimer(rmtimer[textid]);
- Delete3DTextLabel(mtexts[textid]);
- return true;
- }
- stock AttachMoveable3DTextToVehicle(textid, vehid, Float:offsetx = 0.0, Float:offsety = 0.0, Float:offsetz = 0.0)
- {
- if(textid > rmtid) return printf("[RaFaeL] (Error) Invalid textid: %d", textid);
- Attach3DTextLabelToVehicle(mtexts[textid], vehid, offsetx, offsety, offsetz);
- return true;
- }
- stock AttachMoveable3DTextToPlayer(textid, playerid, Float:offsetx = 0.0, Float:offsety = 0.0, Float:offsetz = 0.0)
- {
- if(textid > rmtid) return printf("[RaFaeL] (Error) Invalid textid: %d", textid);
- Attach3DTextLabelToPlayer(mtexts[textid], playerid, offsetx, offsety, offsetz);
- return true;
- }
- stock UpdateMoveable3DTextLabelText(textid, string[], color, speed = 1)
- {
- if(textid > rmtid) return printf("[RaFaeL] (Error) Invalid textid: %d", textid);
- format(texton3dtext[textid], sizeof(texton3dtext), "%s ", string);
- rmtcolor[textid] = color;
- KillTimer(rmtimer[textid]);
- rmtimer[textid] = SetTimerEx("Move3DText", speed*100, true, "i",textid);
- return true;
- }
- forward Move3DText(txtid2);
- public Move3DText(txtid2)
- {
- format(rmstring1[txtid2], 2, "%c", texton3dtext[txtid2]);
- strdel(texton3dtext[txtid2], 0, 1);
- strcat(texton3dtext[txtid2], rmstring1[txtid2]);
- Update3DTextLabelText(mtexts[txtid2], rmtcolor[txtid2], texton3dtext[txtid2]);
- }
Advertisement
Add Comment
Please, Sign In to add comment