• make spectators not use this
    4 replies, posted
so i have this code but i want to make it so in ttt spectators cant use this because as it is now they can say like "hax nacho is a t" and they can talk to everyone because of this [CODE]if SERVER then AddCSLuaFile("autorun/voicecons.lua") end if CLIENT then print( "Chat Commands Publish 5 Loaded" ) print( "By Kruel Kramer" ) end USay = {} --Emoticons Start USay.WordList = { ["Hes here"] = "vo/streetwar/nexus/male01/c17_10_heshere.wav"; ["hes here"] = "vo/streetwar/nexus/male01/c17_10_heshere.wav"; ["hes here"] = "vo/streetwar/nexus/male01/c17_10_heshere.wav"; ["Hes here"] = "vo/streetwar/nexus/male01/c17_10_heshere.wav"; ["Let us out"] = "vo/streetwar/nexus/male01/c17_10_letusout.wav"; ["let us out"] = "vo/streetwar/nexus/male01/c17_10_letusout.wav"; ["All down"] = "vo/streetwar/nexus/ba_alldown.wav"; ["all down"] = "vo/streetwar/nexus/ba_alldown.wav"; ["down"] = "vo/streetwar/nexus/ba_alldown.wav"; ["They're coming from the roofs"] = "vo/streetwar/nexus/ba_comingfromroof.wav"; ["Theyre coming from the roofs"] = "vo/streetwar/nexus/ba_comingfromroof.wav"; ["they're coming from the roofs"] = "vo/streetwar/nexus/ba_comingfromroof.wav"; ["theyre coming from the roofs"] = "vo/streetwar/nexus/ba_comingfromroof.wav"; ["roofs"] = "vo/streetwar/nexus/ba_comingfromroof.wav"; ["We're surrounded!"] = "vo/streetwar/nexus/ba_surrounded.wav"; ["Were surrounded!"] = "vo/streetwar/nexus/ba_surrounded.wav"; ["We're surrounded"] = "vo/streetwar/nexus/ba_surrounded.wav"; ["we're surrounded!"] = "vo/streetwar/nexus/ba_surrounded.wav"; ["were surrounded"] = "vo/streetwar/nexus/ba_surrounded.wav"; ["surrounded"] = "vo/streetwar/nexus/ba_surrounded.wav"; ["Then let's go"] = "vo/streetwar/nexus/ba_thenletsgo.wav"; ["Then lets go"] = "vo/streetwar/nexus/ba_thenletsgo.wav"; ["then let's go"] = "vo/streetwar/nexus/ba_thenletsgo.wav"; ["then lets go"] = "vo/streetwar/nexus/ba_thenletsgo.wav"; ["You deal with them"] = "vo/streetwar/nexus/ba_turretsyoudeal.wav"; ["you deal with them"] = "vo/streetwar/nexus/ba_turretsyoudeal.wav"; ["Watch out for the humpers!"] = "vo/streetwar/barricade/male01/c17_05_hoppers.wav"; ["watch out for the humpers!"] = "vo/streetwar/barricade/male01/c17_05_hoppers.wav"; ["Watch out for the humpers"] = "vo/streetwar/barricade/male01/c17_05_hoppers.wav"; ["watch out for the humpers"] = "vo/streetwar/barricade/male01/c17_05_hoppers.wav"; ["Let us through!"] = "vo/streetwar/barricade/male01/c17_05_letusthru.wav"; ["let us through!"] = "vo/streetwar/barricade/male01/c17_05_letusthru.wav"; ["Let us through"] = "vo/streetwar/barricade/male01/c17_05_letusthru.wav"; ["let us through"] = "vo/streetwar/barricade/male01/c17_05_letusthru.wav"; ["Open the gates!"] = "vo/streetwar/barricade/male01/c17_05_opengate.wav"; ["open the gates!"] = "vo/streetwar/barricade/male01/c17_05_opengate.wav"; ["Open the gates"] = "vo/streetwar/barricade/male01/c17_05_opengate.wav"; ["open the gates"] = "vo/streetwar/barricade/male01/c17_05_opengate.wav"; ["Set the traps"] = "vo/streetwar/nexus/ba_settraps.wav"; ["set the traps"] = "vo/streetwar/nexus/ba_settraps.wav"; ["We've been spotted!"] = "vo/streetwar/nexus/ba_spotted.wav"; ["Weve been spotted!"] = "vo/streetwar/nexus/ba_spotted.wav"; ["we've been spotted!"] = "vo/streetwar/nexus/ba_spotted.wav"; ["weve been spotted!"] = "vo/streetwar/nexus/ba_spotted.wav"; ["Roll a grenade in there"] = "vo/streetwar/nexus/ba_rollgrenade.wav"; ["roll a grenade in there"] = "vo/streetwar/nexus/ba_rollgrenade.wav"; ["Roof access is this way"] = "vo/streetwar/nexus/ba_roofaccess.wav"; ["roof access is this way"] = "vo/streetwar/nexus/ba_roofaccess.wav"; ["roof access"] = "vo/streetwar/nexus/ba_roofaccess.wav"; ["Roof access"] = "vo/streetwar/nexus/ba_roofaccess.wav"; ["Come on, Gordon!"] = "vo/streetwar/Alyx_gate/al_comeon03_r.wav"; ["Get out of here Gordon!"] = "vo/streetwar/Alyx_gate/al_gordonrun.wav"; ["Hey"] = "vo/streetwar/Alyx_gate/al_hey.wav"; ["Hurry"] = "vo/streetwar/Alyx_gate/al_hurry.wav"; ["I'm waiting Gordon"] = "vo/streetwar/Alyx_gate/al_imwaiting_r.wav"; ["Nooo!"] = "vo/streetwar/Alyx_gate/al_no.wav"; ["Ready when you are"] = "vo/streetwar/Alyx_gate/al_readywhenyou.wav"; ["That's it"] = "vo/streetwar/Alyx_gate/al_thatsit.wav"; ["/r That's it"] = "vo/streetwar/Alyx_gate/al_thatsit_r.wav"; ["Watch my back"] = "vo/streetwar/Alyx_gate/al_watchmyback.wav"; ["Did you just hear a cat just now?"] = "vo/streetwar/sniper/ba_hearcat.wav"; ["Capital Malcompliance"] = "npc/overwatch/cityvoice/f_capitalmalcompliance_spkr.wav"; ["Civil Status"] = "npc/overwatch/cityvoice/f_comfirmcivilstatus_1_spkr.wav"; ["Off-World Relocation"] = "npc/overwatch/cityvoice/f_trainstation_offworldrelocation_spkr.wav"; ["Miscount Detected"] = "npc/overwatch/cityvoice/f_trainstation_cooperation_spkr.wav"; ["Civil Protection!"] = "vo/npc/male01/civilprotection01.wav"; ["Combine!"] = "vo/npc/male01/combine01.wav"; ["CPs!"] = "vo/npc/male01/cps01.wav"; ["Fantastic"] = "vo/npc/male01/fantastic01.wav"; ["Finally"] = "vo/npc/male01/finally.wav"; ["GTHO"] = "vo/npc/male01/gethellout.wav"; ["Get the hell out!"] = "vo/npc/male01/gethellout.wav"; ["Good God"] = "vo/npc/male01/goodgod.wav"; ["Now what?"] = "vo/npc/male01/gordead_ans01.wav"; ["And things were going so well"] = "vo/npc/male01/gordead_ans02.wav"; ["Oh God"] = "vo/npc/male01/gordead_ans04.wav"; ["Please no"] = "vo/npc/male01/gordead_ans06.wav"; ["plz no"] = "vo/npc/male01/gordead_ans06.wav"; ["If you say"] = "vo/npc/male01/gordead_ans07.wav"; ["Why go on?"] = "vo/npc/male01/gordead_ans13.wav"; ["Dibs on the suit"] = "vo/npc/male01/gordead_ans16.wav"; ["Dibs"] = "vo/npc/male01/gordead_ans16.wav"; ["dibs"] = "vo/npc/male01/gordead_ans16.wav"; ["Somebody, take his crowbar"] = "vo/npc/male01/gordead_ans20.wav"; ["This can't be"] = "vo/npc/male01/gordead_ques06.wav"; ["He's dead!"] = "vo/npc/male01/gordead_ques07.wav"; ["I thought he was invincible"] = "vo/npc/male01/gordead_ques11.wav"; ["Got one"] = "vo/npc/male01/gotone01.wav"; ["Got one!"] = "vo/npc/male01/gotone02.wav"; ["Gunship!"] = "vo/npc/male01/gunship02.wav"; ["HAX"] = "vo/npc/male01/hacks01.wav"; ["hax"] = "vo/npc/male01/hacks01.wav"; ["hacks"] = "vo/npc/male01/hacks01.wav"; ["H4X"] = "vo/npc/male01/hacks02.wav"; ["h4x"] = "vo/npc/male01/hacks02.wav"; ["h4cks"] = "vo/npc/male01/hacks02.wav"; ["Headcrabs"] = "vo/npc/male01/headcrabs.wav"; ["Heads up"] = "vo/npc/male01/headsup01.wav"; ["Help"] = "vo/npc/male01/help01.wav"; ["Here comes the HAX"] = "vo/npc/male01/herecomehacks01.wav"; ["Hi"] = "vo/npc/male01/hi02.wav"; ["hi"] = "vo/npc/male01/hi02.wav"; ["Hai"] = "vo/npc/male01/hi02.wav"; ["hai"] = "vo/npc/male01/hi02.wav"; ["I'll stay here"] = "vo/npc/male01/illstayhere01.wav"; ["I'll hold down this spot"] = "vo/npc/male01/holddownspot01.wav"; ["I'm hurt"] = "vo/npc/male01/imhurt02.wav"; ["Imcoming!"] = "vo/npc/male01/incoming02.wav"; ["Let's go!"] = "vo/npc/male01/letsgo01.wav"; ["Let's go"] = "vo/npc/male01/letsgo02.wav"; ["Like that"] = "vo/npc/male01/likethat.wav"; ["I got my corner"] = "vo/npc/male01/littlecorner01.wav"; ["My arm"] = "vo/npc/male01/myarm01.wav"; ["My gut"] = "vo/npc/male01/mygut02.wav"; ["My leg"] = "vo/npc/male01/myleg01.wav"; ["Nice"] = "vo/npc/male01/nice.wav"; ["No no"] = "vo/npc/male01/no01.wav"; ["No"] = "vo/npc/male01/no02.wav"; ["Oh no"] = "vo/npc/male01/ohno.wav"; ["Ok"] = "vo/npc/male01/ok01.wav"; ["Sometimes, I dream about cheese"] = "vo/npc/male01/question06.wav"; ["cheese"] = "vo/npc/male01/question06.wav"; ["Some day, this will all be a bad memory"] = "vo/npc/male01/question20.wav"; ["/sing"] = "vo/npc/male01/question23.wav"; ["Bullshit"] = "vo/npc/male01/question26.wav"; ["BS"] = "vo/npc/male01/question26.wav"; ["Run for your life!"] = "vo/npc/male01/runforyourlife01.wav"; ["Sorry"] = "vo/npc/male01/sorry01.wav"; ["sry"] = "vo/npc/male01/sorry01.wav"; ["Stop it"] = "vo/npc/male01/stopitfm.wav"; ["Strider!"] = "vo/npc/male01/strider.wav"; ["Run!"] = "vo/npc/male01/strider_run.wav"; ["Watch out!"] = "vo/npc/male01/watchout.wav"; ["You got it"] = "vo/npc/male01/youg
Change the first line of USay.ChatFunction to something along the lines of this: [code]if ply:IsValid() and ply:Team() ~= TEAM_SPECTATOR then[/code]
Also, on line 2 you should change it to [lua]AddCSLuaFile()[/lua] and the file name wont matter.
[QUOTE=samm5506;41805728]Change the first line of USay.ChatFunction to something along the lines of this: [code]if ply:IsValid() and ply:Team() ~= TEAM_SPECTATOR then[/code][/QUOTE] If it's TTT then it has the built in meta function player:IsTerror()
THANK YOU ALL SO MUCH
Sorry, you need to Log In to post a reply to this thread.