• Print

Author Topic: Quick question on if statements  (Read 12651 times)

0 Members and 1 Guest are viewing this topic.

Offline WispySkies

  • Full Member
  • ***
  • Posts: 144
  • Karma: 0
  • I make random commands and Lua errors.
Re: Quick question on if statements
« Reply #30 on: November 03, 2015, 01:31:09 pm »
Hmm :(

[ERROR] addons/ulx/lua/ulx/modules/sh/duel.lua:12: '(' expected near ':'
  1. unknown - addons/ulx/lua/ulx/modules/sh/duel.lua:0

Code: Lua
  1. local CATEGORY_NAME = "Advanced Simplicity"
  2.  
  3. function ulx.duel( ply, weapon, target )
  4.         ply:ChatPrint( target, "Challenged #T to a duel with #s.", weapon )
  5.         target:ChatPrint( ply, "#A challenged you to a duel with #s.", weapon )
  6.         hook.Add( "PlayerSay", "PlayerSayExample", function( ply, text, team )
  7.         if not ply == target or not text == "!accept" then return true end
  8.         sbox_godmode:GetConVar( "sbox_godmode" ) -- Gets original value of sbox_godmode, see after player death.
  9.         game.ConsoleCommand( "sbox_godmode 0" )
  10.         game.ConsoleCommand( "ulx god *" )
  11.         game.ConsoleCommand( ply, "ulx ungod #A,#T", target )
  12.         local function GM:SpawnMenuEnabled()
  13.                 if ply:IsUserGroup( "superadmin" ) or target:IsUserGroup( "superadmin" ) then
  14.                         return true
  15.                 else
  16.                         return false
  17.                 end
  18.         end
  19.         ply:Give( weapon )
  20.         target:Give( weapon )
  21.         if weapon == "m9k_davy_crockett" or weapon == "m9k_orbital_strike" then
  22.                 ply:ChatPrint( "Nice try getting past URS, Davy Crockets and Orbital Air Strikes are NOT allowed!" )
  23.                 target:ChatPrint( "Nice try getting past URS, Davy Crockets and Orbital Air Strikes are NOT allowed!" )
  24.         end
  25.         PrintMessage( HUD_PRINTTALK, "Fight!" )
  26.         if not ply:IsAlive() or target:IsAlive() then
  27.                 PrintMessage( HUD_PRINTTALK, "Duel over!" )
  28.                 game.ConsoleCommand( "ulx ungod *" )
  29.                 game.ConsoleCommand( "sbox_godmode" .. sbox_godmode:GetBool( "sbox_godmode" ) ) -- Checks the original value to set it back to the normal sbox_godmode.
  30.                 local function GM:SpawnMenuEnabled()
  31.                 return true
  32.                 end
  33.         end
  34.         end )
  35. end
  36. local duel = ulx.command( CATEGORY_NAME, "ulx duel", ulx.duel, "!duel" )
  37. duel:defaultAccess( ULib.ACCESS_ALL )
  38. duel:addParam{ type = ULib.cmds.PlayerArg }
  39. duel:help( "Duel a friend or enemy!" )
  40.  

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Quick question on if statements
« Reply #31 on: November 03, 2015, 08:31:35 pm »
Challenge him to a duel.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Caustic Soda-Senpai

  • Sr. Member
  • ****
  • Posts: 469
  • Karma: 54
  • <Insert something clever here>
    • Steam Page
Re: Quick question on if statements
« Reply #32 on: November 04, 2015, 12:25:52 am »
Once you get to know me, you'll find you'll have never met me at all.

Offline WispySkies

  • Full Member
  • ***
  • Posts: 144
  • Karma: 0
  • I make random commands and Lua errors.
Re: Quick question on if statements
« Reply #33 on: November 04, 2015, 04:16:53 am »

  • Print