AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Detect spectating? (https://forums.alliedmods.net/showthread.php?t=22663)

Obbin 01-01-2006 06:53

Detect spectating?
 
How to: If "id" (loop all) spectating and admin call func(id)


Thx!

VEN 01-01-2006 08:49

This is the right way:
Code:
// new players[32], num, tchar[2] get_players(players, num, "b") for (new i = 0; i < num; ++i) {     get_user_team(players[i], tchar, 1)     if (tchar[0] == 'S' && get_user_flags(players[i]) > 0 && !(get_user_flags(players[i]) & ADMIN_USER)) {         // ...     } }

Note for those who think that get_players(players, num, "e", "SPECTATOR") is better.
This isn't good way because sometimes get_players works incorrect with "e"-flag.

Sandurr 01-01-2006 10:55

if(!is_user_alive(id)) =P

Obbin 01-01-2006 11:08

ty!

VEN 01-01-2006 11:57

Quote:

Originally Posted by Sandurr
if(!is_user_alive(id)) =P

Is you can see i used "b" flag for that purpose so this is not needed.


All times are GMT -4. The time now is 16:11.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.