Fearless Forums
/prop command - gives prop's location (such as model/x/x) - Printable Version

+- Fearless Forums (https://fearlessrp.net)
+-- Forum: CityRP Server (https://fearlessrp.net/forumdisplay.php?fid=6)
+--- Forum: Suggestions (https://fearlessrp.net/forumdisplay.php?fid=7)
+---- Forum: Finished (https://fearlessrp.net/forumdisplay.php?fid=26)
+---- Thread: /prop command - gives prop's location (such as model/x/x) (/showthread.php?tid=80520)

Pages: 1 2


/prop command - gives prop's location (such as model/x/x) - Conn - 05-15-2017

Title of Suggestion: ^

Description: A /prop command, which will print the prop the user is looking at.
My Example:


Spoiler :

Code:
hook.Add( "PlayerSay" , "SayPlayer" , function( ply, text, tChat )
    text = string.lower( text )
    if ( text == "/prop" ) then
        local eye = ply:GetEyeTrace()
        if IsValid(eye.Entity) then
            PrintMessage(HUD_PRINTTALK,"Model: ".. eye.Entity:GetModel())
        else
            PrintMessage(HUD_PRINTTALK,"This is not a physics prop!")
        end
    end
end )

^ Something simple, just like that.
Looking at 2x4 metal phx prop response =
Model: models/props_phx/construct/metal_plate2x4.mdl


Why: Times I have been asked what prop I am using in a build, or other people want to know. This is a simple solution to that.


RE: /prop command - gives prop's location (such as model/x/x) - Yonno - 05-15-2017

+support, I see no disadvantages to this.


RE: /prop command - gives prop's location (such as model/x/x) - Floodify - 05-15-2017

+support


RE: /prop command - gives prop's location (such as model/x/x) - Wolven - 05-15-2017

+support


RE: /prop command - gives prop's location (such as model/x/x) - Balls - 05-15-2017

+Support


RE: /prop command - gives prop's location (such as model/x/x) - Rylund - 05-15-2017

I've seen this suggested before, no idea where the suggestion went though.
This would be a good addition, both for the author of a build but also for people wanting to know what props people use to build with.

+Support

Side note: The code you've posted in the OP would not fit FL as it doesn't follow the general CityRP command structure.


RE: /prop command - gives prop's location (such as model/x/x) - Tomo - 05-15-2017

+Support


RE: /prop command - gives prop's location (such as model/x/x) - Luna - 05-15-2017

+Support


RE: /prop command - gives prop's location (such as model/x/x) - Conn - 05-15-2017

(05-15-2017, 02:45 PM)SnowredWolf Wrote: I've seen this suggested before, no idea where the suggestion went though.
This would be a good addition, both for the author of a build but also for people wanting to know what props people use to build with.

+Support

Side note: The code you've posted in the OP would not fit FL as it doesn't follow the general CityRP command structure.

Ah, learning gLua now so just something simple I threw together.


RE: /prop command - gives prop's location (such as model/x/x) - Rylund - 05-15-2017

(05-15-2017, 02:53 PM)connbob Wrote:
(05-15-2017, 02:45 PM)SnowredWolf Wrote: I've seen this suggested before, no idea where the suggestion went though.
This would be a good addition, both for the author of a build but also for people wanting to know what props people use to build with.

+Support

Side note: The code you've posted in the OP would not fit FL as it doesn't follow the general CityRP command structure.

Ah, learning gLua now so just something simple I threw together.

Something like this would probably work, just wrote it quickly to give you a general idea.  Smile


Spoiler :
Code:
-- Command to print path of current prop the user is looking at
cityrp.command.add("getprop", "b", 0, function(ply)
    local ent = ply:GetEyeTrace().Entity
    if IsEntity(ent) then
        ply:ChatPrint(ent:GetModel())
    else
        ply:Notify("You are not aiming at a valid entity!", 1)
    end
end, "Commands", "<none>", "Prints the path of the prop you are looking at")