last terrorist help
would this work so that only the last terrorist can use my menu:
if( is_user_alive(iPlayerID) && cs_get_user_team(iPlayerID) == CS_TEAM_T && CS_TEAM_T == 1 ) ?? I know that says if the player is alive and the player is on the terrorist team, but would that work? Thanks for all help |
Re: last terrorist help
Didn't I already make this?
EDIT: I did once but it was never confirmed as working completely. |
Re: last terrorist help
Untested
PHP Code:
|
Re: last terrorist help
You have to define "Team", you forget it :D
You can try in stead of "Team" "CS_TEAM_T" |
Re: last terrorist help
Quote:
|
Re: last terrorist help
Quote:
Or this code provided by fysiks would work even better: PHP Code:
|
Re: last terrorist help
If the function worked properly then that would obviously be the fastest and easiest way. The problem is that passing flags with get_players() does not always return valid results; I tested the function with various flags and got mixed results. On one occassion, passing "ae" to the function would return players as normal (alive,team) then the next day, identical plugin\code, it would always return 0 players even though there were players that matched the passed criteria. The function should not be used with flags if it is not always going to work consistently. This is why I called it with no flags and did the alive\team checking manually.
http://www.amxmodx.org/funcwiki.php?go=func&id=174 Quote:
PHP Code:
|
Re: last terrorist help
Not fastest, though.
The use of flags slow down the function, a lot. The fastest way would be looping through 1 and get_maxplayers() checking if the user is alive and if the user is in that team. Calling an extra function (get_players in this case) will copy the IDs of the players to your array, and will very likely do the very same checks than my method. |
Re: last terrorist help
Quote:
|
Re: last terrorist help
Quote:
Thanks again |
| All times are GMT -4. The time now is 22:41. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.