Author Topic: Setspawns Command  (Read 3073 times)

0 Members and 2 Guests are viewing this topic.

Offline PETREKILLAH

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
Setspawns Command
« on: July 02, 2016, 12:28:38 PM »
This sub-forum is only for help or discussion regarding projects created by Team Ulysses. If you are requesting help, please search the forums FIRST to make sure your question has not already been answered. If you still need help, fill in the following information.

Game mode(s) I am having this problem on:darkrp

I am trying to create a ulx command that basically sets all of the class spawns in one place in one command. This is what I have and it doesn't seem to be working.

function ulx.setspawns( calling_ply )
   calling_ply:Say( "/setspawn recruit",teamOnly=false )
   calling_ply:Say( "/setspawn ct",teamOnly=false )
   calling_ply:Say( "/setspawn clt",teamOnly=false )
   calling_ply:Say( "/setspawn ccap",teamOnly=false )
   calling_ply:Say( "/setspawn 501stt",teamOnly=false )
   calling_ply:Say( "/setspawn csgt",teamOnly=false )
   calling_ply:Say( "/setspawn 501stmedic",teamOnly=false )
   calling_ply:Say( "/setspawn 501sthws",teamOnly=false )
   calling_ply:Say( "/setspawn 501stat",teamOnly=false )
   calling_ply:Say( "/setspawn 501stsgt",teamOnly=false )
   calling_ply:Say( "/setspawn 501stlt",teamOnly=false )
   calling_ply:Say( "/setspawn 501stcap",teamOnly=false )
   calling_ply:Say( "/setspawn 501starc",teamOnly=false )
   calling_ply:Say( "/setspawn 212tht",teamOnly=false )
   calling_ply:Say( "/setspawn 212thmedic",teamOnly=false )
   calling_ply:Say( "/setspawn 212thhws",teamOnly=false )
   calling_ply:Say( "/setspawn 212that",teamOnly=false )
   calling_ply:Say( "/setspawn 212thsgt",teamOnly=false )
   calling_ply:Say( "/setspawn 212thlt",teamOnly=false )
   calling_ply:Say( "/setspawn 212thco",teamOnly=false )
   calling_ply:Say( "/setspawn 2ndpa",teamOnly=false )
   calling_ply:Say( "/setspawn 2ndplt",teamOnly=false )
   calling_ply:Say( "/setspawn gmt",teamOnly=false )
   calling_ply:Say( "/setspawn gmmedic",teamOnly=false )
   calling_ply:Say( "/setspawn gmhws",teamOnly=false )
   calling_ply:Say( "/setspawn gmat",teamOnly=false )
   calling_ply:Say( "/setspawn gmsgt",teamOnly=false )
   calling_ply:Say( "/setspawn gmlt",teamOnly=false )
   calling_ply:Say( "/setspawn gmco",teamOnly=false )
   calling_ply:Say( "/setspawn wpt",teamOnly=false )
   calling_ply:Say( "/setspawn wpmedic",teamOnly=false )
   calling_ply:Say( "/setspawn wphws",teamOnly=false )
   calling_ply:Say( "/setspawn wpsgt",teamOnly=false )
   calling_ply:Say( "/setspawn wplt",teamOnly=false )
   calling_ply:Say( "/setspawn wpco",teamOnly=false )
   calling_ply:Say( "/setspawn kshws",teamOnly=false )
   calling_ply:Say( "/setspawn ksmedic",teamOnly=false )
   calling_ply:Say( "/setspawn ksat",teamOnly=false )
   calling_ply:Say( "/setspawn ksbs",teamOnly=false )
   calling_ply:Say( "test",teamOnly=false )
end

local setspawns = ulx.command( "Fun", "ulx setspawns", ulx.setspawns, "!setspawns" )
setspawns:defaultAccess( ULib.ACCESS_ADMIN ) -- Register ULX minimum required default access. In this case, admin
setspawns:help( "Sets all spawns" ) -- show this in previously set (in ulx.command) "help" category

Offline OpticPotatOS

  • Jr. Member
  • **
  • Posts: 53
  • Karma: 0
  • GLaDOS
    • Gaming for Everyone
Re: Setspawns Command
« Reply #1 on: July 02, 2016, 01:39:53 PM »
Any errors in console? Or does it just not work?
My website isn't my website, rather, it's the gaming network my sever is connected to.

ttt.gfe.nu

Unforeseen Consequences

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: Setspawns Command
« Reply #2 on: July 02, 2016, 06:48:43 PM »
I believe Garry's Mod has a minimum time between chat messages, so trying to say all of those command one after another is likely to be under that minimum time. I suggest you try using the timer library, or finding the actual command's function and calling that.
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

Offline iViscosity

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 803
  • Karma: 58
Re: Setspawns Command
« Reply #3 on: July 03, 2016, 01:55:40 AM »
Why do you have the "teamOnly=" in there? It should just be "false". If it works, whatever.



Anyways, I've done some research on DarkRP as I'm not very familiar with it and found the documentation for addTeamSpawnPos


So I'd try something like making a command that calls that function. I think this page could be helpful.
I'm iViscosity. I like gaming and programming. Need some help? Shoot me PM.

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: Setspawns Command
« Reply #4 on: July 03, 2016, 11:31:57 AM »
Why do you have the "teamOnly=" in there? It should just be "false". If it works, whatever.
Well there's one thing---I don't think that's valid Lua. That may be one issue!

edit: a word
« Last Edit: July 04, 2016, 12:29:29 PM by Bytewave »
bw81@ulysses-forums ~ % whoami
Homepage

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: Setspawns Command
« Reply #5 on: July 04, 2016, 05:13:20 AM »
You don't think that's not valid Lua? Did you accidentally put 'not' in there, or do you mean to say you think it is valid Lua?

(yes, it is invalid Lua code)
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: Setspawns Command
« Reply #6 on: July 04, 2016, 12:30:13 PM »
You don't think that's not valid Lua? Did you accidentally put 'not' in there, or do you mean to say you think it is valid Lua?

(yes, it is invalid Lua code)
It's the summer sleep schedule---not quite 100% awake even at 1 PM. :p
bw81@ulysses-forums ~ % whoami
Homepage

Offline iViscosity

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 803
  • Karma: 58
Re: Setspawns Command
« Reply #7 on: July 04, 2016, 09:29:20 PM »
It's the summer sleep schedule---not quite 100% awake even at 1 PM. :p

Yeah it was 5 AM when I wrote my post... I don't even know if I knew what I was saying.
I'm iViscosity. I like gaming and programming. Need some help? Shoot me PM.