• Getting a DarkRP job
    2 replies, posted
When a player gets a job, you need to produce a sound. I use this command, but nothing happens Where is the mistake? if ( ply:Team( ) == TEAM_CITIZEN ) then activator:EmitSound("combined/k_lab/k_lab_kl_helloalyx01_cc.wav", 90, 100, 1, CHAN_AUTO)
just doing a if statement wont do it since the if statement probably runs once at some point, when the player is NOT the job, and then never again. You need to put this if statement in a hook (or a hook itserlf that runs when someone becomes a job) and THEN run the if check.
Like Trackster said, there's a hook for player changing Job, you should put it in a function CODE: function ChangeJob( ply ) if ( ply:Team() == TEAM_CITIZEN ) then activator:EmitSound("combined/k_lab/k_lab_kl_helloalyx01_cc.wav", 90, 100, 1, CHAN_AUTO) return end end hook.Add( "OnPlayerChangedTeam", "ChangeJobSound", ChangeJob ) I'm pretty sure the return isn't needed but I'm new to coding myself, I hope this works out for you!
Sorry, you need to Log In to post a reply to this thread.