+ Reply to Thread
Results 1 to 4 of 4

Thread: Need help with the fin functions.

  1. #1
    Wire Noob MephistoFFF is on a distinguished road MephistoFFF's Avatar
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    24

    Default Need help with the find() functions.

    Hi there!
    I hope you guys can help me.

    I want to do the following with only one E2. I need to find flying RPGs to one Array and a special prop to a different array. But if I do the following...:
    e2 Code:
    1. findByClass("rpg_missile")
    2. RPGs = findToArray()
    3.  
    4. findByModel("Modelpath")
    5. Props = findToArray()
    ...both array will contain both, RPG and the props, won't they?
    I hope you understand what I want to do and of course I thank you in advance.
    Last edited by MephistoFFF; 07-03-2009 at 06:52 AM.
    om nom nom nom

  2. #2
    Wire Sofaking Donkie is on a distinguished road Donkie's Avatar
    Join Date
    May 2008
    Location
    Sweden ofc
    Posts
    632

    Default Re: Need help with the fin functions.

    Make some kinda toggle variable that toggles every 0.01 second and when its on it will use findByClass and that RPG and when its off it will use the findByModel
    Quote Originally Posted by l3ulletje View Post
    Because making a thing which makes a thing saves you from ever have to make a thing again, you just tell your thing to make a thing and you have your new thing ready to use for something.
    Edit: But then again, a thing which can make everything is a unthinkable thing, I do think I can think of something which your thing can't make.

  3. #3
    Wire Noob MephistoFFF is on a distinguished road MephistoFFF's Avatar
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    24

    Default Re: Need help with the fin functions.

    Quote Originally Posted by donkan View Post
    Make some kinda toggle variable that toggles every 0.01 second and when its on it will use findByClass and that RPG and when its off it will use the findByModel
    That doesn't work. Both arrays still find both, rpgs and props.

    Now, I think I got it, but the code looks terrible:
    e2 Code:
    1. findIncludeClass("rpg_missile")
    2. findIncludeModel("models/hunter/misc/sphere075x075.mdl")
    3. findExcludeClass("gmod_wire_spawner")
    4. findInSphere(entity():pos(),100000000)
    5. All = findToArray()
    6. All_Count = All:count()
    7.  
    8.  
    9. if($All_Count){
    10. All_Index=0
    11. Prop = array()
    12. RPG = array()
    13. }
    14.  
    15. if(All_Index<All_Count){
    16. All_Index += 1
    17. if(All:entity(All_Index):model()==
    18. "models/hunter/misc/sphere075x075.mdl"&
    19. All:entity(All_Index):owner()==owner()){
    20. Prop:setEntity(Prop:count()+1,All:entity(All_Index))
    21. RPG = RPG
    22. }
    23. if(All:entity(All_Index):type()=="rpg_missile"){
    24. RPG:setEntity(RPG:count()+1,All:entity(All_Index))
    25. Prop = Prop
    26. }
    27. }
    Last edited by MephistoFFF; 07-03-2009 at 07:06 AM.
    om nom nom nom

  4. #4
    Wirererer eurocracy is on a distinguished road eurocracy's Avatar
    Join Date
    Sep 2007
    Posts
    102

    Default Re: Need help with the fin functions.

    Wow O.o that is some pretty bad lookin code there XD
    My sig was 201 pixels long so moderators snipped it
    Oh teh noes!

+ Reply to Thread

Similar Threads

  1. functions
    By bobthe2lol in forum Expression Help
    Replies: 2
    Last Post: 06-24-2009, 08:22 AM
  2. E2 seat functions!
    By Azrael in forum Wiremod Lua Coding
    Replies: 18
    Last Post: 05-08-2009, 11:14 PM
  3. E2 - CJ's functions
    By [FX]CJ[CrS] in forum Wiremod Addons
    Replies: 5
    Last Post: 04-22-2009, 11:36 AM
  4. E-2 some functions.
    By Whodunnit in forum Ideas & Suggestions
    Replies: 12
    Last Post: 03-11-2009, 04:31 AM
  5. E2: Few new functions
    By d3cr1pt0r in forum Wiremod Lua Coding
    Replies: 24
    Last Post: 02-22-2009, 09:17 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts