GUI Stats Panel | V-0.3

Started by !, Oct 04, 2017, 05:00 PM

Previous topic - Next topic

!


Discord: zeus#5155

.

#1
First: E:/DONE TO HARD DISK/What/The/ACTUAL/F#/Long/PATH?

Second: For the love of god. Just drag the folder where the scripts are stored onto Notepad++ to have it available as a directory tree on a left side-panel. Because that tab mess you have there doesn't impress anyone.

Third: You don't seem to be escaping PropName so you're likely to be subject to SQL injections. Thank god the VC:MP players are not familiar with this practice.

And third: I don't know whether this is the best that VC:MP GUI can offer but that's a pretty pathetic style. With enough effort, you could've achieved this with sprites and text-draws back in the day. Of course, without the cursor and auto-scaling. Because there was no way to access that information.

That being said. At least it's something. So you get the props for effort.
.

!

#2
Quote from: . on Oct 04, 2017, 07:42 PMFirst: E:/DONE TO HARD DISK/What/The/ACTUAL/F#/Long/PATH?
Because I was transferring my data from old hard driver to this one and the directory E is external hard drive.All the stuff in it was copied in a hurry.

Quote from: . on Oct 04, 2017, 07:42 PMSecond: For the love of god. Just drag the folder where the scripts are stored onto Notepad++ to have it available as a directory tree on a left side-panel. Because that tab mess you have there doesn't impress anyone.
As already told you the data was copied in a hurry due to which mistakenly script files were messed up with each other thats why checking the files I need.

Quote from: . on Oct 04, 2017, 07:42 PMThird: You don't seem to be escaping PropName so you're likely to be subject to SQL injections. Thank god the VC:MP players are not familiar with this practice.
Escaping has already applied on the arguments so I don't think it is necessary to do it in query too ???.I am not much sure whether it is necessary to escape inside query or okay to do it from outside. :-\

Quote from: . on Oct 04, 2017, 07:42 PMWith enough effort, you could've achieved this with sprites and text-draws back in the day.
Actually I don't think cause it was not so hard to make this panel.
  • One background window
  • 4 sub windows out of which 2 windows are resized
  • 8 slots(labels) for each sub window except for the fourth one
  • And 4 buttons
It's not hard if you know the things you need to start working.

Quote from: . on Oct 04, 2017, 07:42 PMOf course, without the cursor and auto-scaling. Because there was no way to access that information.
Once again it is not hard if knew about simple mathematics and able to make some simple formulas.
Simple example for handling the spaces with the help of simplest mathematics.
local
   cScreenSize = GUI.GetScreenSize(),
   cSpaceX = ( cScreenSize.X - ( ( cScreenSize.X / 4 ) * 3 ) ) / 4, /* The x-axis spaces we need on left and right side of panel as well as in the middle of sub windows */
   cSpaceY = ( cScreenSize.Y - ( ( cScreenSize.Y / 4 ) * 3 ) ) / 3; /* Same for the y-axis */
Merge the formulas if possible to get the things you need.Similar method applies to other.

Lots of time was wasted on reducing the load on server.I mean I am not that type of noob to directly get the data from database and load it for the user. :D PS: as a newbie much of my time was wasted on this.

 :edit:
Quote from: . on Oct 04, 2017, 07:42 PMAnd third: I don't know whether this is the best that VC:MP GUI can offer but that's a pretty pathetic style.
Thanks ^-^ for this one :)

Discord: zeus#5155

.

Quote from: zeus on Oct 05, 2017, 11:00 AMOnce again it is not hard if knew about simple mathematics and able to make some simple formulas.
Simple example for handling the spaces with the help of simplest mathematics.
local
   cScreenSize = GUI.GetScreenSize(),
   cSpaceX = ( cScreenSize.X - ( ( cScreenSize.X / 4 ) * 3 ) ) / 4, /* The x-axis spaces we need on left and right side of panel as well as in the middle of sub windows */
   cSpaceY = ( cScreenSize.Y - ( ( cScreenSize.Y / 4 ) * 3 ) ) / 3; /* Same for the y-axis */
Merge the formulas if possible to get the things you need.Similar method applies to other.

Lots of time was wasted on reducing the load on server.I mean I am not that type of noob to directly get the data from database and load it for the user. :D PS: as a newbie much of my time was wasted on this.

I'm nut much of a number cruncher myself. But I'd say I know a few or two things. So tell me, what `formulas` or `mathematics` do you apply to nothing? Void, empty, absence or whatever you prefer. Because I'm curious how you could've managed to apply anything to something that doesn't exist. Like the client-side scripting. Or even the possibility of acquiring client screen information. As I mentioned. Anyway, you probably didn't get what I meant by the "being able to make it with sprites and text-draws if you were sadistic enough". My bad.
.

!

#4
Quote from: . on Oct 05, 2017, 08:24 PMI'm nut much of a number cruncher myself. But I'd say I know a few or two things.
I think more than that even much much better then me.

Quote from: . on Oct 05, 2017, 08:24 PMSo tell me, what `formulas` or `mathematics` do you apply to nothing? Void, empty, absence or whatever you prefer. Because I'm curious how you could've managed to apply anything to something that doesn't exist. Like the client-side scripting. Or even the possibility of acquiring client screen information. As I mentioned. Anyway, you probably didn't get what I meant by the "being able to make it with sprites and text-draws if you were sadistic enough". My bad.
Still I am not sure what you just said but this is how it could be achieved.Not tested it but I bet it's going to work.

This Snippet will creates a main window and two sub-windows
GUI_Test <- {
   Windows =   {   Main = null,   Slot1 = null,   Slot2 = null   },
   
   function Create( )
   {
      local
         cScreenSize = GUI.GetScreenSize(),
         /* Some basics suppose client x is  1000 so we will split it into 3, 1st & 2nd  for sub windows & 3rd for spaces */
         SplitX = cScreenSize.X / 3,
         /* The sub windows x size is a portion of splitted x */
         sSubWinX = SplitX,
         /* Same applied for y axis but at y axis we need two spaces upper & lower but we are not going to split it into 2 cause we need more space for sub windows y, hence split the y into 4 out of which three will be accord for sub windows y while 4th for the spaces */
         SplitY = cScreenSize.y / 4,
         /* Sub windows y size 3 portions of splitted y */
         sSubWinY = SplitY * 3,
         /* Space x since we need 3 spaces(left, right & middle one) for x so splliting 1 portion of splitted x into 3 will give us a space x */
         SpaceX = SplitX / 3,
         /* Space y since for y we need 2 spaces(upper & lower) for y so splliting 1 portion of splitted y into 2 will give us the space y */
         SpaceX = SplitY / 2,
         
         /* Time to grab the data for positions */
         /* Position x for first sub window */
         /* Okay so for the first window position we have to add the space-x to it i mean the left side space x by doing it like this */
         pWinAX = SpaceX,
         /* Position x for second sub window */
         /* So for the second window position we have to add 2 x spaces( left and the middle one ) and the x size of win x to it */
         pWinBX = ( SpaceX * 2 ) + sSubWinX,
         
         /* Since the y position of both window is same( Upper SpaceY ) so */
         pWinAY = SpaceY,
         pWinBY = SpaceY;
     
      Windows["Main"] = ::GUIWindow( VectorScreen( -1, -1 ), VectorScreen( cScreenSize.X + 2, cScreenSize.Y + 2 ), Colour( 0, 0, 0, 120 ), "Test Panel" );
      Windows["Main"].RemoveFlags( GUI_FLAG_BORDER | GUI_FLAG_DRAGGABLE | GUI_FLAG_WINDOW_TITLEBAR | GUI_FLAG_WINDOW_CLOSEBTN | GUI_FLAG_WINDOW_RESIZABLE | GUI_FLAG_SHADOW );
     
      Windows["Slot1"] = ::GUIWindow( VectorScreen( pWinAX, pWinAY ), VectorScreen( sSubWinX, sSubWinY ), Colour( 10, 145, 110 ), "First Sub Window" );
      Windows["Slot1"].RemoveFlags( GUI_FLAG_BORDER | GUI_FLAG_DRAGGABLE | GUI_FLAG_WINDOW_TITLEBAR | GUI_FLAG_WINDOW_CLOSEBTN | GUI_FLAG_WINDOW_RESIZABLE | GUI_FLAG_SHADOW );
     
      Windows["Slot2"] = ::GUIWindow( VectorScreen( pWinBX, pWinBY ), VectorScreen( sSubWinX, sSubWinY ), Colour(  10, 145, 110  ), "Second Sub Window" );
      Windows["Slot2"].RemoveFlags( GUI_FLAG_BORDER | GUI_FLAG_DRAGGABLE | GUI_FLAG_WINDOW_TITLEBAR | GUI_FLAG_WINDOW_CLOSEBTN | GUI_FLAG_WINDOW_RESIZABLE | GUI_FLAG_SHADOW );
   }
     
   function UponResize( )
   {
      Windows["Main"] = null;
      Windows["Slot1"] = null;
      Windows["Slot2"] = null;
     
      Create( );
   }
}

Discord: zeus#5155

VK.Jona83Killer


.

@zeus you still didn't get me. back in the days of sprites and text-draws, there was no client-side scripting. so your `formulas` or `mathematics` will be as useless as they can get. that's what I meant with not being able to apply that to something that doesn't exist.

still not getting it?
.

kennedyarz


Zone_Killer

Bohemia Is God Of Punjabi Rap
Yo Yo Honey Singh tou chutiya hai

!


Discord: zeus#5155

SAzEe21