21.06.2016, 19:52
It's not a command/FS I made and I'm sure there are no problems with this command but here you go:
pawn Код:
if(!strcmp(cmdtext, "/tde", true, 4))
{
if(ProjectEditor == playerid)
{
if(strlen(cmdtext) >= 6)
{
if( (!strcmp(cmdtext[5], "ayuda", true)) || (!strcmp(cmdtext[5], "help", true)) )
{
SendClientMessage(playerid, -1, "{e2b960}TDEditor: {FFFFFF}/tde box - /tde exit - /tde cursor - /tde select.");
return 1;
}
if( (!strcmp(cmdtext[5], "cursor", true)) )
{
if(MouseCursor)
{
MouseCursor = false;
CancelSelectTextDraw(ProjectEditor);
}
else
{
MouseCursor = true;
SelectTextDraw(ProjectEditor, -1);
}
return 1;
}
if( (!strcmp(cmdtext[5], "select", true)) )
{
SendClientMessage(playerid, -1, " ");
SendClientMessage(playerid, -1, "{e2b960}TDEditor: {FFFFFF}Use /tde selectall to un/select all textdraws.");
SendClientMessage(playerid, -1, "{e2b960}TDEditor: {FFFFFF}Use /tde edit to edit selected textdraws.");
CancelSelectTextDraw(playerid);
IsPSel = false;
ShowSelectTDManage(playerid);
return 1;
}
if( (!strcmp(cmdtext[5], "selectall", true)) )
{
if(selectall)
{
selectall = false;
Loop(0, MAX_PROJECT_TEXTDRAWS) SelectedTextDraws[c] = false;
SendClientMessage(playerid, -1, "{e2b960}TDEditor: {FFFFFF}All textdraws unselected.");
}
else
{
selectall = true;
Loop(0, MAX_PROJECT_TEXTDRAWS) SelectedTextDraws[c] = true;
SendClientMessage(playerid, -1, "{e2b960}TDEditor: {FFFFFF}All textdraws selected.");
}
return 1;
}
if( (!strcmp(cmdtext[5], "edit", true)) )
{
if(moveselectedtds)
{
moveselectedtds = false;
SendClientMessage(playerid, -1, "{e2b960}TDEditor: {FFFFFF}Edit selected textdraws: OFF.");
}
else
{
moveselectedtds = true;
SendClientMessage(playerid, -1, "{e2b960}TDEditor: {FFFFFF}Edit selected textdraws: ON.");
}
return 1;
}
if( (!strcmp(cmdtext[5], "salir", true)) || (!strcmp(cmdtext[5], "exit", true)) )
{
KillTimer(EditorUpdateTimer);
KillTimer(DeleteTimer);
KillTimer(SpeedTimer);
KillTimer(MoveTDTimer); MoveTDTimer = -1;
KillTimer(TDEHTimer); TDEHTimer = -1;
KillTimer(OutlineTimer);
KillTimer(ShadowTimer);
KillTimer(LetterSizeTimer); LetterSizeTimer = -1;
KillTimer(LetterTimer);
KillTimer(EditSizeTDTimer); EditSizeTDTimer = -1;
KillTimer(EditSizeSpeedT);
KillTimer(ShadowTimer);
if(strlen(ProjectFile))
{
SaveProject();
for (new i = 0; i < MAX_PROJECT_TEXTDRAWS; i++) RemoveTextDrawTDEOnly(i);
}
Loop(0, MAX_PROJECT_TEXTDRAWS) SelectedTextDraws[c] = false;
moveselectedtds = false;
selectall = false;
DestroyMenuTextDraws();
EditMode = EDITMODE_NONE;
ColorMode = COLORMODE_NONE;
ProjectEditor = -1;
EditorEnabled = false;
IsPSel = true;
CursorOX = 0;
CursorOY = 0;
CursorX = 0;
CursorY = 0;
ScreenWidth = 0;
ScreenHeight = 0;
OffsetZ = 415.0;
EditIndex = INVALID_INDEX_ID;
EditMoveSpeed = 0.1;
EditLetterSizeSpeed = 0.01;
EditSizeSpeed = 0.01;
PageStart = 0;
MouseCursor = false;
Zoom = 1.0;
EmptyString(ProjectFile);
EmptyString(Pro_Str);
EmptyString(str_list);
EmptyString(line);
TogglePlayerControllable(playerid, true);
ShowPlayerDialog(playerid, -1, 0, "","", "", "" );
CancelSelectTextDraw(playerid);
return 1;
}
if( (!strcmp(cmdtext[5], "box", true)) || (!strcmp(cmdtext[5], "icons", true)) || (!strcmp(cmdtext[5], "adjust", true)) )
{
if(EditMode == EDITMODE_ADJUST)
{
if(!VirtualKeys[26][KEY_PRESSED]) //Left Mouse Button
{
new Float:pos[2];
for(new i = 1; i < sizeof(TDE_Menu); i++)
{
TDE_TextDrawGetPos(TDE_Menu[i], pos[0], pos[1]);
TDE_TextDrawSetPos(TDE_Menu[i], pos[0], OffsetZ);
TDE_TextDrawShowForPlayer(playerid, TDE_Menu[i]);
}
TDE_TextDrawSetString(TD_Status, "EDITMODE_NONE");
EditMode = EDITMODE_NONE;
IsPSel = true;
return 1;
}
return 1;
}
IsPSel = false;
TDE_TextDrawSetString(TD_Status, "EDITMODE_ADJUST");
EditMode = EDITMODE_ADJUST;
SendClientMessage(playerid, -1, "{e2b960}TDEditor: {FFFFFF}Press 'ESC' to finish this mode.");
return 1;
}
return SendClientMessage(playerid, -1, "{e2b960}TDEditor: {FFFFFF}/tde {e2b960}(box/help)");
}
TDE_TextDrawSetString(TD_Status, "EDITMODE_NONE");
EditMode = EDITMODE_NONE;
CancelSelectTextDraw(playerid);
IsPSel = false;
ShowPlayerDialog(playerid, DIALOG_PROJECT, DIALOG_STYLE_LIST, "TDEditor", "Create a new project\nLoad a project\nClose project", ">>", "X");
}
if(ProjectEditor == -1)
{
new ip[16];
GetPlayerIp(playerid, ip, 16);
if(strcmp(ip, "127.0.0.1", false)) return SendClientMessage(playerid, -1, "{e2b960}TDEditor: {FFFFFF}TDEditor only can be used from localhost (127.0.0.1)");
IsPSel = true;
MouseCursor = true;
TogglePlayerControllable(playerid, false);
DestroyMenuTextDraws();
CreateMenuTextDraws();
SendClientMessage(playerid, -1, "{e2b960}TDEditor 1.17 {FFFFFF}Click on the image to start...");
TDE_TextDrawShowForPlayer(playerid, TDELOGO);
SelectTextDraw(playerid, -1);
EmptyString(ProjectFile);
}
return true;
}