Last active
November 26, 2022 12:42
-
-
Save ZeroCool1997/5ebe2e92c62240845ada to your computer and use it in GitHub Desktop.
Samp Scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
||||||| |||||| |||||||||| ||||||| || || |||||||||| | |
|| || || || || || || || | |
||||||| || || || ||||||| |||| || | |
|| || || || || || || || | |
||||||| |||||| || ||||||| || || || | |
3D Text Labels Creator V1.0 RC2 By Zero_Cool | |
*/ | |
#include <a_samp> | |
#define Type_Default 0 | |
#define Type_AttOnVehicle 1 | |
#define Diag 2012 | |
#define Dialog 2013 | |
#define MAX_3DTL 100 | |
#define D_STR_OPTIONS "Change 3D Text Label String\n3D Text Label Color\nAttach 3D Text Label To Vehicle\nDelete 3D Text Label" | |
#define D_STR_EXPORT "Classic Mode\nPlayer 3D Text Labels" | |
#define D_STR_COLOR "Write an hexadecimal number\nSelect a predefinded color" | |
#define D_STR_ATTACH "Edit X\nEdit Y\nEdit Z" | |
#define D_STR_COLORS "Red\nBlue\nWhite\nGreen\nYellow\nOrange\nBlack\nPink" | |
enum info | |
{ | |
Attached, | |
Created, | |
Text3D:TextID, | |
Text[256], | |
Color, | |
Type, | |
Float:tX, | |
Float:tY, | |
Float:tZ | |
} | |
enum info2 | |
{ | |
OnOff, | |
Float:eX, | |
Float:eY, | |
Float:eZ | |
} | |
new CText[MAX_3DTL][info]; | |
new EditText[info2]; | |
new InProject[MAX_PLAYERS]; | |
new Courrent3DT[MAX_PLAYERS]; | |
public OnFilterScriptInit() | |
{ | |
print("\n-------------------------------------------------"); | |
print(" 3D Text Labels Creator V1.0 RC2 By Zero_Cool "); | |
print(" Loaded "); | |
print("-------------------------------------------------\n"); | |
SetTimer("KeyUpdate",100,1); | |
return 1; | |
} | |
public OnFilterScriptExit() | |
{ | |
print("\n-------------------------------------------------"); | |
print(" 3D Text Labels Creator V1.0 RC2 By Zero_Cool "); | |
print(" UnLoaded "); | |
print("-------------------------------------------------\n"); | |
return 1; | |
} | |
public OnPlayerCommandText(playerid, cmdtext[]) | |
{ | |
if (!strcmp(cmdtext, "/3dtext", true) || !strcmp(cmdtext, "/text", true) || !strcmp(cmdtext, "/3dt", true)) | |
{ | |
ShowFristDialog(playerid); | |
return 1; | |
} | |
return 0; | |
} | |
new DialogPage[MAX_PLAYERS]; | |
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) | |
{ | |
if(dialogid == Diag) | |
{ | |
if(response) | |
if(listitem == 0) | |
{ | |
for(new i;i<MAX_3DTL;i++) | |
{ | |
if(!CText[i][Created]) | |
{ | |
new Float:X,Float:Y,Float:Z; | |
GetPlayerPos(playerid,X,Y,Z); | |
format(CText[i][Text],256,"3D TextLabel%d",i); | |
CText[i][Type] = Type_Default; | |
CText[i][Color] = HexToInt("0xFFFFFFAA"); | |
CText[i][tX] = X; | |
CText[i][tY] = Y; | |
CText[i][tZ] = Z; | |
CText[i][TextID] = Create3DTextLabel(CText[i][Text],HexToInt("0xFFFFFFAA"),X,Y,Z,30.0,0); | |
CText[i][Created] = 1; | |
ShowFristDialog(playerid); | |
return 1; | |
} | |
} | |
return 1; | |
} | |
if(listitem == 1) | |
{ | |
ShowPlayerDialog(playerid,Dialog+6,DIALOG_STYLE_LIST,"{298ACF}3D Text Labels Creator",D_STR_EXPORT,"Select","Back"); | |
} | |
if(listitem < 10) | |
{ | |
new id = 2; | |
for(new i=DialogPage[playerid];i<MAX_3DTL;i++) | |
{ | |
if(CText[i][Created]) | |
{ | |
if(id == listitem) | |
{ | |
Courrent3DT[playerid] = i; | |
ShowPlayerDialog(playerid,Dialog,DIALOG_STYLE_LIST,CreateTitle(playerid),D_STR_OPTIONS,"Select","Back"); | |
break; | |
} | |
id++; | |
} | |
} | |
} | |
else | |
{ | |
new count,id; | |
for(new i=DialogPage[playerid];i<MAX_3DTL;i++) | |
{ | |
if(CText[i][Created]) | |
{ | |
count ++; | |
id = i; | |
if(count == 9) break; | |
} | |
} | |
DialogPage[playerid] = id; | |
ShowFristDialog(playerid); | |
} | |
if(!response) DialogPage[playerid] = 0; | |
} | |
if(dialogid == Dialog) | |
{ | |
if(response) | |
{ | |
if(listitem == 0) | |
{ | |
new str[256]; | |
format(str,sizeof(str),"Write the new 3DTextLabel%d String\n",Courrent3DT[playerid]); | |
ShowPlayerDialog(playerid,Dialog+1,DIALOG_STYLE_INPUT,CreateTitle(playerid),str,"Ok","Back"); | |
} | |
if(listitem == 1) | |
{ | |
ShowPlayerDialog(playerid,Dialog+2,DIALOG_STYLE_LIST,CreateTitle(playerid),D_STR_COLOR,"Select","Back"); | |
} | |
if(listitem == 2) | |
{ | |
if(IsPlayerInAnyVehicle(playerid)) | |
{ | |
if(CText[Courrent3DT[playerid]][Attached] == 0) | |
{ | |
Attach3DTextLabelToVehicle(CText[Courrent3DT[playerid]][TextID],GetPlayerVehicleID(playerid),0.0,0.0,0.0); | |
CText[Courrent3DT[playerid]][tX] = 0; | |
CText[Courrent3DT[playerid]][tY] = 0; | |
CText[Courrent3DT[playerid]][tZ] = 0; | |
CText[Courrent3DT[playerid]][Type] = Type_AttOnVehicle; | |
CText[Courrent3DT[playerid]][Attached] = 1; | |
ShowPlayerDialog(playerid,Dialog+5,DIALOG_STYLE_LIST,CreateTitle(playerid),D_STR_ATTACH,"Select","Back"); | |
} | |
else | |
{ | |
ShowPlayerDialog(playerid,Dialog+5,DIALOG_STYLE_LIST,CreateTitle(playerid),D_STR_ATTACH,"Select","Back"); | |
} | |
} | |
else | |
{ | |
SendClientMessage(playerid,-1,"ERROR: You are not in a vehicle"); | |
ShowPlayerDialog(playerid,Dialog,DIALOG_STYLE_LIST,CreateTitle(playerid),D_STR_OPTIONS,"Select","Back"); | |
} | |
} | |
if(listitem == 3) | |
{ | |
Delete3DTextLabel(CText[Courrent3DT[playerid]][TextID]); | |
format(CText[Courrent3DT[playerid]][Text],256,"3D Text Label"); | |
CText[Courrent3DT[playerid]][Type] = Type_Default; | |
CText[Courrent3DT[playerid]][Color] = HexToInt("0xFFFFFFAA"); | |
CText[Courrent3DT[playerid]][tX] = 0; | |
CText[Courrent3DT[playerid]][tY] = 0; | |
CText[Courrent3DT[playerid]][tZ] = 0; | |
CText[Courrent3DT[playerid]][Created] = 0; | |
CText[Courrent3DT[playerid]][Attached] = 0; | |
new str[256]; | |
format(str,sizeof(str),"{6EF83C}INFO: {FFFFFF}3DTextLabel%d Deleted",Courrent3DT[playerid]); | |
SendClientMessage(playerid,-1,str); | |
ShowFristDialog(playerid); | |
} | |
} | |
else | |
{ | |
ShowFristDialog(playerid); | |
} | |
} | |
if(dialogid == Dialog+1) | |
{ | |
if(response) | |
{ | |
new str[256]; | |
format(str,sizeof(str),"Write the new 3DTextLabel%d String\n",Courrent3DT[playerid]); | |
if(!strlen(inputtext)) return ShowPlayerDialog(playerid,Dialog+1,DIALOG_STYLE_INPUT,CreateTitle(playerid),str,"Ok","Back"); | |
format(CText[Courrent3DT[playerid]][Text],256,"%s",inputtext); | |
Update3DTextLabelText(CText[Courrent3DT[playerid]][TextID],CText[Courrent3DT[playerid]][Color],inputtext); | |
format(str,sizeof(str),"{6EF83C}INFO: {FFFFFF}3DTextLabel%d String Changed To: %s",Courrent3DT[playerid],inputtext); | |
SendClientMessage(playerid,-1,str); | |
ShowPlayerDialog(playerid,Dialog,DIALOG_STYLE_LIST,CreateTitle(playerid),D_STR_OPTIONS,"Select","Back"); | |
} | |
else | |
{ | |
ShowPlayerDialog(playerid,Dialog,DIALOG_STYLE_LIST,CreateTitle(playerid),D_STR_OPTIONS,"Select","Back"); | |
} | |
} | |
if(dialogid == Dialog+2) | |
{ | |
if(response) | |
{ | |
if(listitem == 0) | |
{ | |
ShowPlayerDialog(playerid,Dialog+4,DIALOG_STYLE_INPUT,CreateTitle(playerid),"Write an hexadecimal number\n","Ok","Back"); | |
} | |
if(listitem == 1) | |
{ | |
ShowPlayerDialog(playerid,Dialog+3,DIALOG_STYLE_LIST,CreateTitle(playerid),D_STR_COLORS,"Select","Back"); | |
} | |
} | |
else | |
{ | |
ShowPlayerDialog(playerid,Dialog,DIALOG_STYLE_LIST,CreateTitle(playerid),D_STR_OPTIONS,"Select","Back"); | |
} | |
} | |
if(dialogid == Dialog+3) | |
{ | |
if(response) | |
{ | |
switch (listitem) | |
{ | |
case 0: | |
{ | |
Update3DTextLabelText(CText[Courrent3DT[playerid]][TextID],HexToInt("0xFF0000AA"),CText[Courrent3DT[playerid]][Text]); | |
CText[Courrent3DT[playerid]][Color] = HexToInt("0xFF0000AA"); | |
new str[256]; | |
format(str,sizeof(str),"{6EF83C}INFO: {FFFFFF}3DTextLabel%d Color Changed To Red",Courrent3DT[playerid]); | |
SendClientMessage(playerid,-1,str); | |
ShowPlayerDialog(playerid,Dialog,DIALOG_STYLE_LIST,CreateTitle(playerid),D_STR_OPTIONS,"Select","Back"); | |
} | |
case 1: | |
{ | |
Update3DTextLabelText(CText[Courrent3DT[playerid]][TextID],HexToInt("0x375FFFFF"),CText[Courrent3DT[playerid]][Text]); | |
CText[Courrent3DT[playerid]][Color] = HexToInt("0x375FFFFF"); | |
new str[256]; | |
format(str,sizeof(str),"{6EF83C}INFO: {FFFFFF}3DTextLabel%d Color Changed To Blue",Courrent3DT[playerid]); | |
SendClientMessage(playerid,-1,str); | |
ShowPlayerDialog(playerid,Dialog,DIALOG_STYLE_LIST,CreateTitle(playerid),D_STR_OPTIONS,"Select","Back"); | |
} | |
case 2: | |
{ | |
Update3DTextLabelText(CText[Courrent3DT[playerid]][TextID],HexToInt("0xFFFFFFAA"),CText[Courrent3DT[playerid]][Text]); | |
CText[Courrent3DT[playerid]][Color] = HexToInt("0xFFFFFFAA"); | |
new str[256]; | |
format(str,sizeof(str),"{6EF83C}INFO: {FFFFFF}3DTextLabel%d Color Changed To White",Courrent3DT[playerid]); | |
SendClientMessage(playerid,-1,str); | |
ShowPlayerDialog(playerid,Dialog,DIALOG_STYLE_LIST,CreateTitle(playerid),D_STR_OPTIONS,"Select","Back"); | |
} | |
case 3: | |
{ | |
Update3DTextLabelText(CText[Courrent3DT[playerid]][TextID],HexToInt("0x33FF33AA"),CText[Courrent3DT[playerid]][Text]); | |
CText[Courrent3DT[playerid]][Color] = HexToInt("0x33FF33AA"); | |
new str[256]; | |
format(str,sizeof(str),"{6EF83C}INFO: {FFFFFF}3DTextLabel%d Color Changed To Green",Courrent3DT[playerid]); | |
SendClientMessage(playerid,-1,str); | |
ShowPlayerDialog(playerid,Dialog,DIALOG_STYLE_LIST,CreateTitle(playerid),D_STR_OPTIONS,"Select","Back"); | |
} | |
case 4: | |
{ | |
Update3DTextLabelText(CText[Courrent3DT[playerid]][TextID],HexToInt("0xFFFF00AA"),CText[Courrent3DT[playerid]][Text]); | |
CText[Courrent3DT[playerid]][Color] = HexToInt("0xFFFF00AA"); | |
new str[256]; | |
format(str,sizeof(str),"{6EF83C}INFO: {FFFFFF}3DTextLabel%d Color Changed To Yellow",Courrent3DT[playerid]); | |
SendClientMessage(playerid,-1,str); | |
ShowPlayerDialog(playerid,Dialog,DIALOG_STYLE_LIST,CreateTitle(playerid),D_STR_OPTIONS,"Select","Back"); | |
} | |
case 5: | |
{ | |
Update3DTextLabelText(CText[Courrent3DT[playerid]][TextID],HexToInt("0xFF9900AA"),CText[Courrent3DT[playerid]][Text]); | |
CText[Courrent3DT[playerid]][Color] = HexToInt("0xFF9900AA"); | |
new str[256]; | |
format(str,sizeof(str),"{6EF83C}INFO: {FFFFFF}3DTextLabel%d Color Changed To Orange",Courrent3DT[playerid]); | |
SendClientMessage(playerid,-1,str); | |
ShowPlayerDialog(playerid,Dialog,DIALOG_STYLE_LIST,CreateTitle(playerid),D_STR_OPTIONS,"Select","Back"); | |
} | |
case 6: | |
{ | |
Update3DTextLabelText(CText[Courrent3DT[playerid]][TextID],HexToInt("0x2C2727AA"),CText[Courrent3DT[playerid]][Text]); | |
CText[Courrent3DT[playerid]][Color] = HexToInt("0x2C2727AA"); | |
new str[256]; | |
format(str,sizeof(str),"{6EF83C}INFO: {FFFFFF}3DTextLabel%d Color Changed To Black",Courrent3DT[playerid]); | |
SendClientMessage(playerid,-1,str); | |
ShowPlayerDialog(playerid,Dialog,DIALOG_STYLE_LIST,CreateTitle(playerid),D_STR_OPTIONS,"Select","Back"); | |
} | |
case 7: | |
{ | |
Update3DTextLabelText(CText[Courrent3DT[playerid]][TextID],HexToInt("0xFF66FFAA"),CText[Courrent3DT[playerid]][Text]); | |
CText[Courrent3DT[playerid]][Color] = HexToInt("0xFF66FFAA"); | |
new str[256]; | |
format(str,sizeof(str),"{6EF83C}INFO: {FFFFFF}3DTextLabel%d Color Changed To Pink",Courrent3DT[playerid]); | |
SendClientMessage(playerid,-1,str); | |
ShowPlayerDialog(playerid,Dialog,DIALOG_STYLE_LIST,CreateTitle(playerid),D_STR_OPTIONS,"Select","Back"); | |
} | |
} | |
} | |
else | |
{ | |
ShowPlayerDialog(playerid,Dialog,DIALOG_STYLE_LIST,CreateTitle(playerid),D_STR_OPTIONS,"Select","Back"); | |
} | |
} | |
if(dialogid == Dialog+4) | |
{ | |
if(response) | |
{ | |
if(!strlen(inputtext)) return ShowPlayerDialog(playerid,Dialog+4,DIALOG_STYLE_INPUT,"{298ACF}3D Text Label Creator","Write an hexadecimal number\n","Ok","Back"); | |
CText[Courrent3DT[playerid]][Color] = HexToInt(inputtext); | |
Update3DTextLabelText(CText[Courrent3DT[playerid]][TextID],CText[Courrent3DT[playerid]][Color],CText[Courrent3DT[playerid]][Text]); | |
ShowPlayerDialog(playerid,Dialog,DIALOG_STYLE_LIST,CreateTitle(playerid),D_STR_OPTIONS,"Select","Back"); | |
} | |
else | |
{ | |
ShowPlayerDialog(playerid,Dialog,DIALOG_STYLE_LIST,CreateTitle(playerid),D_STR_OPTIONS,"Select","Back"); | |
} | |
} | |
if(dialogid == Dialog+5) | |
{ | |
if(response) | |
{ | |
if(listitem == 0) | |
{ | |
EditText[eX] = 1; | |
EditText[eY] = 0; | |
EditText[eZ] = 0; | |
EditText[OnOff] = 1; | |
} | |
if(listitem == 1) | |
{ | |
EditText[eY] = 1; | |
EditText[eX] = 0; | |
EditText[eZ] = 0; | |
EditText[OnOff] = 1; | |
} | |
if(listitem == 2) | |
{ | |
EditText[eZ] = 1; | |
EditText[eX] = 0; | |
EditText[eY] = 0; | |
EditText[OnOff] = 1; | |
} | |
} | |
else | |
{ | |
ShowPlayerDialog(playerid,Dialog,DIALOG_STYLE_LIST,CreateTitle(playerid),D_STR_OPTIONS,"Select","Back"); | |
} | |
} | |
if(dialogid == Dialog+6) | |
{ | |
if(response) | |
{ | |
if(listitem == 0){Export(playerid,0);} | |
if(listitem == 1){Export(playerid,1);} | |
} | |
else | |
{ | |
ShowFristDialog(playerid); | |
} | |
} | |
return 1; | |
} | |
forward KeyUpdate(playerid); | |
public KeyUpdate(playerid) | |
{ | |
if(CText[Courrent3DT[playerid]][Attached] == 1 && EditText[OnOff] == 1) | |
{ | |
new keys, updown, leftright; | |
GetPlayerKeys(playerid, keys, updown, leftright); | |
if(keys == KEY_YES) | |
{ | |
if(EditText[OnOff] == 1) | |
{ | |
EditText[OnOff] = 0; | |
ShowPlayerDialog(playerid,Dialog,DIALOG_STYLE_LIST,CreateTitle(playerid),D_STR_OPTIONS,"Select","Back"); | |
} | |
} | |
if(leftright == KEY_LEFT) | |
{ | |
if(CText[Courrent3DT[playerid]][Type] == Type_AttOnVehicle) | |
{ | |
if(EditText[eX] == 1) | |
{ | |
CText[Courrent3DT[playerid]][tX] += 0.1; | |
Attach3DTextLabelToVehicle(CText[Courrent3DT[playerid]][TextID],GetPlayerVehicleID(playerid),CText[Courrent3DT[playerid]][tX],CText[Courrent3DT[playerid]][tY],CText[Courrent3DT[playerid]][tZ]); | |
} | |
if(EditText[eY] == 1) | |
{ | |
CText[Courrent3DT[playerid]][tY] += 0.1; | |
Attach3DTextLabelToVehicle(CText[Courrent3DT[playerid]][TextID],GetPlayerVehicleID(playerid),CText[Courrent3DT[playerid]][tX],CText[Courrent3DT[playerid]][tY],CText[Courrent3DT[playerid]][tZ]); | |
} | |
if(EditText[eZ] == 1) | |
{ | |
CText[Courrent3DT[playerid]][tZ] += 0.1; | |
Attach3DTextLabelToVehicle(CText[Courrent3DT[playerid]][TextID],GetPlayerVehicleID(playerid),CText[Courrent3DT[playerid]][tX],CText[Courrent3DT[playerid]][tY],CText[Courrent3DT[playerid]][tZ]); | |
} | |
} | |
ModifyText(playerid); | |
} | |
if(leftright == KEY_RIGHT) | |
{ | |
if(CText[Courrent3DT[playerid]][Type] == Type_AttOnVehicle) | |
{ | |
if(EditText[eX] == 1) | |
{ | |
CText[Courrent3DT[playerid]][tX] -= 0.1; | |
Attach3DTextLabelToVehicle(CText[Courrent3DT[playerid]][TextID],GetPlayerVehicleID(playerid),CText[Courrent3DT[playerid]][tX],CText[Courrent3DT[playerid]][tY],CText[Courrent3DT[playerid]][tZ]); | |
} | |
if(EditText[eY] == 1) | |
{ | |
CText[Courrent3DT[playerid]][tY] -= 0.1; | |
Attach3DTextLabelToVehicle(CText[Courrent3DT[playerid]][TextID],GetPlayerVehicleID(playerid),CText[Courrent3DT[playerid]][tX],CText[Courrent3DT[playerid]][tY],CText[Courrent3DT[playerid]][tZ]); | |
} | |
if(EditText[eZ] == 1) | |
{ | |
CText[Courrent3DT[playerid]][tZ] -= 0.1; | |
Attach3DTextLabelToVehicle(CText[Courrent3DT[playerid]][TextID],GetPlayerVehicleID(playerid),CText[Courrent3DT[playerid]][tX],CText[Courrent3DT[playerid]][tY],CText[Courrent3DT[playerid]][tZ]); | |
} | |
} | |
ModifyText(playerid); | |
} | |
} | |
return 1; | |
} | |
stock Export(playerid,type) | |
{ | |
new string2[256]; | |
new File:file; | |
new h,m,s,d,mo,y; | |
if(!fexist("3DText.txt")) | |
{ | |
file = fopen("3DText.txt", io_write); | |
} | |
else | |
{ | |
file = fopen("3DText.txt", io_append); | |
} | |
gettime(h,m,s); | |
getdate(y,mo,d); | |
format(string2,sizeof(string2), | |
"\r\n//------------------------------------//\r\n3D Text Label Creator V1.0 RC2 By Zero_Cool\r\nDATE: Day:%d | Month:%d | Year:%d\r\nTIME: Hours:%02d | Minutes:%02d | Seconds:%02d\r\n\n", | |
d,mo,y,h,m,s); | |
fwrite(file,string2); | |
if(type == 0) | |
{ | |
for(new i;i<MAX_3DTL;i++) | |
{ | |
if(CText[i][Created]) | |
{ | |
format(string2,sizeof(string2),"new Text3D:Text%d;\r\n",i); | |
fwrite(file,string2); | |
} | |
} | |
fwrite(file,"\r\n//------------------------------------//\r\n"); | |
for(new i;i<MAX_3DTL;i++) | |
{ | |
if(CText[i][Created]) | |
{ | |
if(CText[i][Type] == 0) | |
{ | |
format(string2,sizeof(string2), | |
"Text%d = Create3DTextLabel(\"%s\",%i,%f,%f,%f,30.0,0,1);\r\n", | |
i, | |
CText[i][Text], | |
CText[i][Color], | |
CText[i][tX], | |
CText[i][tY], | |
CText[i][tZ]); | |
fwrite(file,string2); | |
} | |
else if(CText[i][Type] == 1) | |
{ | |
format(string2,sizeof(string2), | |
"Text%d = Create3DTextLabel(\"%s\",%i,0.0,0.0,0.0,30.0,0,1);\r\nAttach3DTextLabelToVehicle(Text%d,GetPlayerVehicleID(playerid),%f,%f,%f);\r\n", | |
i, | |
CText[i][Text], | |
CText[i][Color], | |
i, | |
CText[i][tX], | |
CText[i][tY], | |
CText[i][tZ]); | |
fwrite(file,string2); | |
} | |
} | |
} | |
} | |
else if(type == 1) | |
{ | |
for(new i;i<MAX_3DTL;i++) | |
{ | |
if(CText[i][Created]) | |
{ | |
format(string2,sizeof(string2),"new PlayerText3D:Text%d;\r\n",i); | |
fwrite(file,string2); | |
} | |
} | |
for(new i;i<MAX_3DTL;i++) | |
{ | |
if(CText[i][Created]) | |
{ | |
if(CText[i][Type] == 0) | |
{ | |
format(string2,sizeof(string2), | |
"Text%d = CreatePlayer3DTextLabel(playerid,\"%s\",%i,%f,%f,%f,30.0,0,1);\r\n", | |
i, | |
CText[i][Text], | |
CText[i][Color], | |
CText[i][tX], | |
CText[i][tY], | |
CText[i][tZ]); | |
fwrite(file,string2); | |
} | |
else if(CText[i][Type] == 1) | |
{ | |
format(string2,sizeof(string2), | |
"Text%d = CreatePlayer3DTextLabel(playerid,\"%s\",%i,0.0,0.0,0.0,30.0,0,1);\r\nAttach3DTextLabelToVehicle(Text%d,GetPlayerVehicleID(playerid),%f,%f,%f);\r\n", | |
i, | |
CText[i][Text], | |
CText[i][Color], | |
i, | |
CText[i][tX], | |
CText[i][tY], | |
CText[i][tZ]); | |
fwrite(file,string2); | |
} | |
} | |
} | |
} | |
fclose(file); | |
SendClientMessage(playerid,-1,"{6EF83C}INFO: {FFFFFF}Script saved, check your 3DText.txt in scriptfiles."); | |
} | |
stock ModifyText(playerid) | |
{ | |
new str[256]; | |
if(EditText[eX] == 1) | |
{ | |
format(str,256,"~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~Offset X: ~w~%f",CText[Courrent3DT[playerid]][tX]); | |
GameTextForPlayer(playerid, str, 1000, 3); | |
} | |
if(EditText[eY] == 1) | |
{ | |
format(str,256,"~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~Offset Y: ~w~%f",CText[Courrent3DT[playerid]][tY]); | |
GameTextForPlayer(playerid, str, 1000, 3); | |
} | |
if(EditText[eZ] == 1) | |
{ | |
format(str,256,"~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~Offset Z: ~w~%f",CText[Courrent3DT[playerid]][tZ]); | |
GameTextForPlayer(playerid, str, 1000, 3); | |
} | |
} | |
stock CreateTitle(playerid) | |
{ | |
new tstr[128]; | |
format(tstr,sizeof(tstr),"{298ACF}3D Text Label Creator: 3DTextLabel%d",Courrent3DT[playerid]); | |
return tstr; | |
} | |
stock HexToInt(string2[]) //By Zamaroht | |
{ | |
if (string2[0]==0) return 0; | |
new i; | |
new cur=1; | |
new res=0; | |
for (i=strlen(string2);i>0;i--) { | |
if (string2[i-1]<58) res=res+cur*(string2[i-1]-48); else res=res+cur*(string2[i-1]-65+10); | |
cur=cur*16; | |
} | |
return res; | |
} | |
stock ShowFristDialog(playerid) | |
{ | |
new string[2048]; | |
new shown; | |
if(InProject[playerid] == 0) | |
{ | |
InProject[playerid] = 1; | |
for(new i=DialogPage[playerid];i<MAX_3DTL;i++) | |
{ | |
if(CText[i][Created]) | |
{ | |
shown++; | |
if(shown == 9) | |
{ | |
format(string, sizeof(string), "%sMore >>>", string); | |
break; | |
} | |
format(string,sizeof(string),"%s3DTLabe%d[%s]\n",string,i,CText[i][Text]); | |
} | |
} | |
format(string,sizeof(string),"New 3D Text Label\nExport\n%s",string); | |
ShowPlayerDialog(playerid,Diag,DIALOG_STYLE_LIST,"{298ACF}3D Text Labels Creator",string,"Select","Cancle"); | |
} | |
else | |
{ | |
for(new i=DialogPage[playerid];i<MAX_3DTL;i++) | |
{ | |
if(CText[i][Created]) | |
{ | |
shown++; | |
if(shown == 9) | |
{ | |
format(string, sizeof(string), "%sMore >>>", string); | |
break; | |
} | |
format(string,sizeof(string),"%s3DTLabe%d[%s]\n",string,i,CText[i][Text]); | |
} | |
} | |
format(string,sizeof(string),"New 3D Text Label\nExport\n%s",string); | |
ShowPlayerDialog(playerid,Diag,DIALOG_STYLE_LIST,"{298ACF}3D Text Labels Creator",string,"Select","Cancle"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment