Only when being terrorist or CT
I try to make make clients who are in the terrorists or CT team say "I'm a terrorist or CT" when the doAction in the plugin is triggered or as soon they are terrorist or CT. When i use the below script clients who are not terrorist or CT say each 2 secconds "I'm a terrorist or CT". However these clients aren't terrorist or CT the "client_cmd(id,"say I'm a terrorists or CT")" line in the script is executed what shouldn't be happened if im right. Anyone can tell me what i did wrong or make a working script?
PHP Code:
|
Re: Only when being terrorist or CT
PHP Code:
PHP Code:
then call it where you want. if you want it to loop every x amounts of seconds PHP Code:
|
Re: Only when being terrorist or CT
Tsk tsk NcB... all that C++ reading has caused you to get sloppy.
Don't use get_user_team, it returns false results sometimes. Also, the code NcB posted had a couple of bracket-eering errors in it. Code:
EDIT: *giggle* at the coincidental timing. |
Re: Only when being terrorist or CT
If you're only using a value once, no need to create a variable.
PHP Code:
PHP Code:
|
Re: Only when being terrorist or CT
All 3 thank you very much :up::up::up:
Ive choicen for wrecked_ his script because spectators and unassigned team players could easely say something to so an extra thumb up for you :up: edit: Reason for the script is to make players who join the T or CT team automaticly execute a command. |
Re: Only when being terrorist or CT
The thing you want to try to avoid is writing the same code twice. If you use the same function on T\CT (aside from a chat msg) you can do this (same for unassigned\spec).
PHP Code:
PHP Code:
|
Re: Only when being terrorist or CT
I have always used get_user_team and have never had an error...
when it returns 0 i believe it just gets handled no actual run time error.. i could be wrong though... |
Re: Only when being terrorist or CT
Quote:
|
Re: Only when being terrorist or CT
Quote:
|
| All times are GMT -4. The time now is 08:40. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.