Advertisement
maramizo

acquire scripts disregard females

Dec 10th, 2015
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 6.11 KB | None | 0 0
  1. SQL:
  2. 1.SELECT * FROM Orders WHERE OrderDate >= '2000-01-01'
  3. 2.SELECT * FROM Customers ORDER BY ContactName DESC;
  4. 3.SELECT * FROM Customers WHERE City = 'Mexico' AND CustomerName LIKE '%M%';
  5. 4.SELECT Orders.OrderID, Customers.CustomerName, Orders.OrderDate FROM Orders INNER JOIN Customers ON Orders.CustomerID = Customers.CustomerID WHERE Customers.CustomerName = 'Alfreds Futterkiste';
  6. 5.SELECT DISTINCT City FROM Customers;
  7. 6.SELECT Customers.CustomerName, Orders.OrderID, Orders.OrderDate FROM Orders RIGHT JOIN Customers ON Orders.CustomerID = Customers.CustomerID ORDER BY Orders.OrderID;
  8. 7.SELECT COUNT(*) AS TotalOrders FROM Orders;
  9. 8.SELECT Customers.CustomerName, COUNT(*) AS 'Total Orders' FROM Customers INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID WHERE Customers.CustomerName = 'Around the Horn';
  10. 9.UPDATE Customers CONCAT(LEFT(PostalCode, 0), 'A', SUBSTRING(PostalCode, 1));
  11. 10.Two Queries:
  12. DELETE FROM Orders WHERE CustomerID IN (SELECT DISTINCT CustomerID FROM Customers WHERE City = 'London');
  13. DELETE FROM Customers WHERE City = 'London';
  14. OR
  15. DELETE Customers, Orders  FROM Customers  INNER JOIN Customers WHERE Customers.CustomerID = Orders.CustomerID AND Customers.City = 'London'
  16.  
  17. Question 1:
  18.  
  19. LOCAL tab = {
  20.   {"Maxime", 5000},
  21.   {"aaufppxf4", 2323},
  22.   {"Sibrecht", 1},
  23.   {"Smith", 542},
  24.   {"Mickel", 542},
  25.   {"Theno", 425},
  26.   {"Mirazoka", 54200}
  27. }
  28. LOCAL output = "" -- The output string, still not formatted.
  29. FOR i=1, TABLE.getn(tab) do -- Vertical loop dynamically based on size of table.
  30.   FOR j=1, TABLE.getn(tab[i]) do -- Horizontal loop dynamically based on size of each group within the table.
  31.     IF(j%2 > 0) THEN
  32.       output = tab[i][j] -- First index due to remainder.
  33.     ELSE
  34.       output = string.format("%s - %u", output, tab[i][j])  -- Second index as there is no remainder.
  35.     END
  36.   END
  37.     outputChatBox(output) -- mfw i didn't even have to make a loop to send to all players and get playercount.
  38. END
  39.  
  40. -- A different method, common easier approach using lua (made this after i felt more familiar with the language now):
  41.  
  42. FOR i=1, TABLE.getn(tab) do -- Vertical loop dynamically based on size of table.
  43.     outputChatBox(tab[i][1] .. " - " .. tab[i][2])
  44. END
  45.  
  46.  
  47. Question 2:
  48. LOCAL tab = {
  49.   {"Maxime", 5000},
  50.   {"aaufppxf4", 2323},
  51.   {"Sibrecht", 1},
  52.   {"Smith", 542},
  53.   {"Mickel", 542},
  54.   {"Theno", 425},
  55.   {"Mirazoka", 54200}
  56. }
  57. FUNCTION whatthefuck(player, command, VALUE)
  58.     IF tonumber(VALUE) ~= nil THEN  -- Check on value being numeric or nah.
  59.         FOR i=1, TABLE.getn(tab) do
  60.             IF(tab[i][2] > VALUE) THEN -- Check on value before output.
  61.                 outputChatBox(tab[i][1] .. " - " .. tab[i][2], player)
  62.             END
  63.         END
  64.     ELSE
  65.         outputChatBox("The value must be numeric.", player)
  66.     END
  67. END
  68. addCommandHandler("show", whatthefuck)
  69.  
  70. Question 3:
  71. FUNCTION sort(a,b) -- holy fuck lua's sorting functions are great
  72.   RETURN a[2] < b[2]
  73. END
  74. FUNCTION whatthefucklol(player, command, VALUE)
  75.     TABLE.sort(tab, sort) -- this is genius
  76.     FOR i=1, TABLE.getn(tab) do
  77.         outputChatBox(tab[i][1] .. " - " .. tab[i][2], player)
  78.     END
  79. END
  80. addCommandHandler("showall", whatthefucklol)
  81.  
  82.  
  83. Question 4:
  84. FUNCTION herp(player, command, INPUT)
  85.     IF(INPUT == '' OR INPUT == nil) THEN RETURN FALSE END -- Empty/Nil returns false.
  86.     IF(INPUT:MATCH("%W")) THEN RETURN FALSE END -- Contains non-alphanumeric characters, %w is used to test on alphanumeric.
  87.     IF(INPUT:MATCH("%s")) THEN RETURN FALSE END -- Contains a space character.
  88.     IF(string.len(INPUT) <= 3 OR string.len(INPUT) >= 10) THEN RETURN FALSE END -- Input equal to or smaller than 3 or equal to and larger than 10, opposite of requirements.
  89.     RETURN TRUE
  90. END
  91. addCommandHandler("randie", herp)
  92.  
  93. Question 5:
  94. addCommandHandler("stats", FUNCTION(thePlayer)
  95.     outputChatBox("IP: " .. getPlayerIP(thePlayer) .. ".")
  96.     outputChatBox("Serial: " .. getPlayerSerial(thePlayer) .. ".")
  97. END)
  98.  
  99. Question 6:
  100. FUNCTION LuckyPay()
  101.   LOCAL luckyPlayer = getRandomPlayer()
  102.   givePlayerMoney(luckyPlayer, 5000)
  103.   outputChatBox("You have been randomly chosen and won $5000! UAT is great and you should suck our dick.", luckyPlayer)
  104.   outputChatBox("Player ID " .. luckyPlayer .. " has won $5000, UAT is great, fuck you.")
  105. END
  106. addEventHandler ("onResourceStart", getResourceRootElement(getThisResource()), FUNCTION()
  107.     setTimer(LuckyPay, 3600000, 0)
  108. END)
  109.  
  110. Question 7:
  111. addCommandHandler("ring", FUNCTION()
  112.     playSound3D("ringtone.mp3", getElementPosition(localplayer))
  113. END)
  114.  
  115. Question 8:
  116. addCommandHandler("ringnearby", FUNCTION()
  117.     LOCAL tone = playSound3D("ringtone.mp3", getElementPosition(localplayer))
  118.     setSoundMaxDistance(tone, 30)
  119. END)
  120.  
  121.  
  122. Question 9:
  123. FUNCTION toglocks(thePlayer)
  124.     guiSetVisible(window, FALSE)
  125.     showCursor(FALSE)
  126.     car = getPlayerOccupiedVehicle(thePlayer)
  127.     IF(car == 0) THEN RETURN FALSE END
  128.     setVehicleLocked(car, bit.bxor(isVehicleLocked(car), 1)) -- Equivalent of setVehicleLocked(car, not isVehicleLocked(car)), bitwise xor.
  129. END
  130. FUNCTION togengine(thePlayer)
  131.     guiSetVisible(window, FALSE)
  132.     showCursor(FALSE)
  133.     car = getPlayerOccupiedVehicle(thePlayer)
  134.     IF(car == 0) THEN RETURN FALSE END
  135.     setVehicleEngineState(car, NOT getVehicleEngineState(car))
  136. END
  137.  
  138. addCommandHandler("carcontrols", FUNCTION(thePlayer)
  139.     window = guiCreateWindow(0.375, 0.375, 0.25, 0.25, "Please Log In", TRUE) -- The GUI positions are random pretty much, cba to test them myself in game and repetitively change them.
  140.     locks = guiCreateButton(0.415, 0.4, 0.2, 0.2, "Lock/Unlock", TRUE, window)
  141.     engine = guiCreateButton(0.435, 0.4, 0.2, 0.2, "Start/Stop Engine", TRUE, window)
  142.     showCursor(TRUE)
  143.     addEventHandler("onClientGUIClick", locks, toglocks, FALSE) -- Naturally I'd choose that the event handlers call upon one function with a parameter which decides whether it's the engine or the locks but I have no idea how to do that here.
  144.     addEventHandler("onClientGUIClick", engine, togengine, FALSE)
  145. END)
  146.  
  147. Question 10:
  148. addCommandHandler("getgun", FUNCTION(thePlayer)
  149.     IF isElementInRange(thePlayer, 0, 0, 0, 10) THEN
  150.         giveWeapon(thePlayer, 22) -- Spawns a colt with 30 ammo to the player.
  151.     ELSE
  152.         outputChatBox("You are not in the gun spawning area.", thePlayer)
  153.     END
  154. END)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement