Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 5.85 KB | None | 0 0
  1. public SQL_ViewJumpStatsCallback(Handle:owner, Handle:hndl, const String:error[], any:data)
  2. {
  3.     new client = data; 
  4.     if(SQL_HasResultSet(hndl) && SQL_FetchRow(hndl))
  5.     {
  6.         decl String:szSteamId[32];             
  7.         decl String:szName[17];
  8.         decl String:szVr[255];
  9.        
  10.         //get the result
  11.         SQL_FetchString(hndl, 0, szSteamId, MAX_NAME_LENGTH); //I want to use this in the menuhandler below, pretty much
  12.         SQL_FetchString(hndl, 1, szName, 17);
  13.         new Float:bhoprecord = SQL_FetchFloat(hndl, 2);
  14.         new Float:bhoppre = SQL_FetchFloat(hndl, 3);
  15.         new Float:bhopmax = SQL_FetchFloat(hndl, 4);
  16.         new bhopstrafes = SQL_FetchInt(hndl, 5);
  17.         new bhopsync = SQL_FetchInt(hndl, 6);
  18.         new Float:ljrecord = SQL_FetchFloat(hndl, 7);
  19.         new Float:ljpre = SQL_FetchFloat(hndl, 8);
  20.         new Float:ljmax = SQL_FetchFloat(hndl, 9);
  21.         new ljstrafes = SQL_FetchInt(hndl, 10);
  22.         new ljsync = SQL_FetchInt(hndl, 11);       
  23.         new Float:multibhoprecord = SQL_FetchFloat(hndl, 12);
  24.         new Float:multibhoppre = SQL_FetchFloat(hndl, 13);
  25.         new Float:multibhopmax = SQL_FetchFloat(hndl, 14);
  26.         new multibhopstrafes = SQL_FetchInt(hndl, 15);
  27.         new multibhopsync = SQL_FetchInt(hndl, 17);
  28.         new Float:wjrecord = SQL_FetchFloat(hndl, 18);
  29.         new Float:wjpre = SQL_FetchFloat(hndl, 19);
  30.         new Float:wjmax = SQL_FetchFloat(hndl, 20);
  31.         new wjstrafes = SQL_FetchInt(hndl, 21);  
  32.         new wjsync = SQL_FetchInt(hndl, 22);   
  33.         new Float:dropbhoprecord = SQL_FetchFloat(hndl, 23);
  34.         new Float:dropbhoppre = SQL_FetchFloat(hndl, 24);
  35.         new Float:dropbhopmax = SQL_FetchFloat(hndl, 25);
  36.         new dropbhopstrafes = SQL_FetchInt(hndl, 26);  
  37.         new dropbhopsync = SQL_FetchInt(hndl, 27)
  38.         new Float:ljheight = SQL_FetchFloat(hndl, 28);
  39.         new Float:bhopheight = SQL_FetchFloat(hndl, 29);
  40.         new Float:multibhopheight = SQL_FetchFloat(hndl, 30);
  41.         new Float:dropbhopheight = SQL_FetchFloat(hndl, 31);
  42.         new Float:wjheight = SQL_FetchFloat(hndl, 32);     
  43.         new ljblockdist = SQL_FetchInt(hndl, 33);  
  44.         new Float:ljblockrecord = SQL_FetchFloat(hndl, 34);    
  45.         new Float:ljblockpre = SQL_FetchFloat(hndl, 35);
  46.         new Float:ljblockmax = SQL_FetchFloat(hndl, 36);
  47.         new ljblockstrafes = SQL_FetchInt(hndl, 37);
  48.         new ljblocksync = SQL_FetchInt(hndl, 38);      
  49.         new Float:ljblockheight = SQL_FetchFloat(hndl, 39);
  50.        
  51.        
  52.         if (bhoprecord >0.0 || ljrecord > 0.0 || multibhoprecord > 0.0 || wjrecord > 0.0 || dropbhoprecord > 0.0 || ljblockdist > 0)
  53.         {  
  54.             Format(szVr, 255, "JS: %s  (%s)\nType              Distance  Strafes Pre        Max   Height  Sync", szName, szSteamId);
  55.             new Handle:menu = CreateMenu(JumpStatsMenuHandler);
  56.             SetMenuTitle(menu, szVr);
  57.             if (ljrecord > 0.0)
  58.             {
  59.                 if (ljstrafes>9)
  60.                     Format(szVr, 255, "LJ:            %.3f   %i   %.2f   %.2f  %.1f %i%c", ljrecord,ljstrafes,ljpre,ljmax,ljheight,ljsync,PERCENT);
  61.                 else
  62.                     Format(szVr, 255, "LJ:            %.3f     %i     %.2f   %.2f  %.1f %i%c", ljrecord,ljstrafes,ljpre,ljmax,ljheight,ljsync,PERCENT);
  63.                 AddMenuItem(menu, szVr, szVr)
  64.             }
  65.             if (ljblockdist > 0)
  66.             {
  67.                 if (ljstrafes>9)
  68.                     Format(szVr, 255, "BlockLJ:  %i|%.1f %i   %.2f   %.2f  %.1f %i%c", ljblockdist,ljblockrecord,ljblockstrafes,ljblockpre,ljblockmax,ljblockheight,ljblocksync,PERCENT);
  69.                 else
  70.                     Format(szVr, 255, "BlockLJ:  %i|%.1f   %i     %.2f   %.2f  %.1f %i%c", ljblockdist,ljblockrecord,ljblockstrafes,ljblockpre,ljblockmax,ljblockheight,ljblocksync,PERCENT);
  71.                 AddMenuItem(menu, szVr, szVr)
  72.             }              
  73.             if (bhoprecord > 0.0)
  74.             {
  75.                 if (bhopstrafes>9)
  76.                     Format(szVr, 255, "Bhop:         %.3f    %i   %.2f   %.2f  %.1f %i%c", bhoprecord,bhopstrafes,bhoppre,bhopmax,bhopheight,bhopsync,PERCENT);
  77.                 else
  78.                     Format(szVr, 255, "Bhop:         %.3f      %i     %.2f   %.2f  %.1f %i%c", bhoprecord,bhopstrafes,bhoppre,bhopmax,bhopheight,bhopsync,PERCENT);
  79.                 AddMenuItem(menu, szVr, szVr)
  80.             }
  81.             if (dropbhoprecord > 0.0)
  82.             {
  83.                 if (dropbhopstrafes>9)
  84.                     Format(szVr, 255, "DropBhop: %.3f    %i   %.2f   %.2f  %.1f %i%c", dropbhoprecord,dropbhopstrafes,dropbhoppre,dropbhopmax,dropbhopheight,dropbhopsync,PERCENT);
  85.                 else
  86.                     Format(szVr, 255, "DropBhop: %.3f      %i     %.2f   %.2f  %.1f %i%c", dropbhoprecord,dropbhopstrafes,dropbhoppre,dropbhopmax,dropbhopheight,dropbhopsync,PERCENT);
  87.                 AddMenuItem(menu, szVr, szVr)
  88.             }  
  89.             if (multibhoprecord > 0.0)
  90.             {
  91.                 if (multibhopstrafes>9)
  92.                     Format(szVr, 255, "MultiBhop: %.3f   %i   %.2f   %.2f  %.1f %i%c", multibhoprecord,multibhopstrafes,multibhoppre,multibhopmax,multibhopheight,multibhopsync,PERCENT);
  93.                 else
  94.                     Format(szVr, 255, "MultiBhop: %.3f     %i     %.2f   %.2f  %.1f %i%c", multibhoprecord,multibhopstrafes,multibhoppre,multibhopmax,multibhopheight,multibhopsync,PERCENT);
  95.                 AddMenuItem(menu, szVr, szVr)
  96.             }
  97.             if (wjrecord > 0.0)
  98.             {
  99.                 if (wjstrafes>9)
  100.                     Format(szVr, 255, "WJ:          %.3f     %i   %.2f   %.2f  %.1f %i%c", wjrecord,wjstrafes,wjpre,wjmax,wjheight,wjsync,PERCENT);
  101.                 else
  102.                     Format(szVr, 255, "WJ:          %.3f       %i     %.2f   %.2f  %.1f %i%c", wjrecord,wjstrafes,wjpre,wjmax,wjheight,wjsync,PERCENT);
  103.                 AddMenuItem(menu, szVr, szVr)
  104.             }
  105.             if(GetUserFlagBits(client) & ADMFLAG_BAN)
  106.             {
  107.             AddMenuItem(menu, "Reset", "Reset Player Jumpstats");
  108.             }
  109.             //SetMenuPagination(menu, 5);
  110.             SetMenuPagination(menu, MENU_NO_PAGINATION);
  111.             SetMenuOptionFlags(menu, MENUFLAG_BUTTON_EXIT);
  112.             DisplayMenu(menu, client, MENU_TIME_FOREVER);  
  113.         }
  114.         else
  115.             PrintToChat(client, "%t", "noJumpRecords",MOSSGREEN,WHITE);
  116.  
  117.        
  118.     }
  119.     else
  120.     {
  121.         PrintToChat(client, "%t", "noJumpRecords",MOSSGREEN,WHITE);
  122.     }
  123. }
  124.  
  125. public JumpStatsMenuHandler(Handle:menu, MenuAction:action, param1,param2)
  126. {  
  127.     if (action ==  MenuAction_Cancel || action ==  MenuAction_Select)
  128.     {
  129.         if (g_bdetailView[param1])
  130.         {
  131.             g_bdetailView[param1] = false;
  132.             JumpTopMenu(param1);
  133.         }
  134.     }
  135.    
  136.     if(action == MenuAction_Select)
  137.     {
  138.         switch(param2)
  139.         {
  140.             case 6:
  141.             {
  142.             ClientCommand(param1, "sm_resetplayerjumpstats %s", szSteamId); //in to here.
  143.             }
  144.         }
  145.     }
  146. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement