• usermessage halp
    8 replies, posted
[url]http://pastebin.com/1apDWMUP[/url] Ok so, I tried to stop players from opening a menu in some rounds of the game because it respawns them, which I don't want, most of the time. What happened is the menu didnt come up ever :( and I put this in console: ] lua_run_cl print(CurrentRound) <<< What I put in console nil <<< The output Why doesn't it work :(
errors bro errors
[QUOTE] ] lua_run_cl print(CurrentRound) <<< What I put in console nil <<< The output [/QUOTE]
Oh I didn't see the pastebin
[lua] cl_init.lua //THIS CONCOMMAND GETS CALLED AFTER SPAWN local CurrentRound usermessage.Hook( "getroundfromserver", function( um ) CurrentRound = um:ReadChar() end ) function zc_setteam() if CurrentRound == 1 or CurrentRound == 2 then //snipped the derma menu else LocalPlayer():PrintMessage( HUD_PRINTCENTER, "YOU CAN ONLY CHANGE TEAMS DURING THE WAITING OR SETUP ROUNDS" ) end end // end the zc_setteam function concommand.Add( "zc_choose", zc_setteam ) //Now we add a hook for the function we just created. init.lua RND_INVALID = 0 RND_SETUP = 1 RND_FIGHT = 2 RND_FIN = 3 CurrentRound = RND_INVALID umsg.Start( "getroundfromserver" ) umsg.Char( CurrentRound ) umsg.End() function SetRound( rnd ) if rnd == RND_INVALID then CurrentRound = RND_INVALID umsg.Start( "getroundfromserver" ) umsg.Char( CurrentRound ) umsg.End() //snipped code that happens here elseif rnd == RND_SETUP then CurrentRound = RND_SETUP umsg.Start( "getroundfromserver" ) umsg.Char( CurrentRound ) umsg.End() //snipped code that happens here elseif rnd == RND_FIGHT then CurrentRound = RND_FIGHT umsg.Start( "getroundfromserver" ) umsg.Char( CurrentRound ) umsg.End() //snipped code that happens here elseif rnd == RND_FIN then CurrentRound = RND_FIN umsg.Start( "getroundfromserver" ) umsg.Char( CurrentRound ) umsg.End() //snipped code that happens here -- you were missing a slash end end [/lua]
edit Aide is a ninja + I was wrong
those comments arent there in the real file... still looking for more suggestions
I fixed it :) ...wtf happened to automerge??? Geezus im gonna get flamed so bad for this -_- is it possible for some moderator to delete this?
[QUOTE=Andriko1;27261833]...wtf happened to automerge??? Geezus im gonna get flamed so bad for this -_-[/QUOTE] Automerge only works in the hour you post your last post.
Sorry, you need to Log In to post a reply to this thread.