• [Help] Command to nickname
    8 replies, posted
I have this code: [CODE]for k,v in pairs(player.GetAll()) do if v:Nick()=="namehere" then net.Start( "hello" ) net.WriteEntity(v) -- v? net.WriteEntity(hello) net.SendToServer() end end[/CODE] how can i make that a concommand will be like: "hello Name" so when i do hello Name it will send net.start hello to the name i wrote
[url]http://wiki.garrysmod.com/page/GM/PlayerSay[/url]
[QUOTE=Robotboy655;45081533][url]http://wiki.garrysmod.com/page/GM/PlayerSay[/url][/QUOTE] its not helping me
[QUOTE=netanelbb;45081543]its not helping me[/QUOTE] How so? Or do you expect me to write everything for you?
can you atleast make the script i wrote in my post work with this? [QUOTE=Robotboy655;45081554]How so? Or do you expect me to write everything for you?[/QUOTE] [CODE]concommand.Add("makehello", function(ply,cmd,args) if args[1] == nil then chat.AddText(Color(255,255,255), "hello: Arguments not valid.") else target = nil for k,v in pairs (player.GetAll()) do if string["find"]( v:Nick():lower(), args[1]:lower() ) then target = v end end if target != nil and target != LocalPlayer() then net.Start("hello") net.WriteString(broken()) net.SendToServer() chat.AddText(Color(255,255,255), "hello: " .. target:Nick() .. " has been banned") else chat.AddText(Color(255,255,255), "hello: Player not found!") end end end)[/CODE]
bump bump
We don't code stuff for you, we give ways for you to code it, like help, links and advices, but no coding.
[QUOTE=netanelbb;45081543]its not helping me[/QUOTE] It's hard to see the magic in that example. Actually knowing what key words to search for will make life as a programmer easier for you. Google: Lua concatenation
Perhaps a youtube tutorial or am I misunderstanding what you want? [url]http://m.youtube.com/watch?v=A-9Whi7AMVo[/url]
Sorry, you need to Log In to post a reply to this thread.