AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Noob question (https://forums.alliedmods.net/showthread.php?t=116175)

Sandro Gubeladze 01-20-2010 14:17

Noob question
 
1. I'm noob :D Don't laugh at me
2. what will this code do?

PHP Code:

   if(get_user_team(x) == 3)
   return 
PLUGIN_HANDLED


it will stop the function if user is in spec team , am i right?

IneedHelp 01-20-2010 14:44

Re: Noob question
 
Quote:

Originally Posted by Sandro Gubeladze (Post 1061451)
it will stop the function if user is in spec team.


Dygear 01-21-2010 13:38

Re: Noob question
 
While get_user_time (amxmodx.inc line 257), is available from the amxmodx include, you can use the enum from cstrike.inc to make the code more readable. The enum is found on line 148 in cstrike.inc and will allow you to do this.
Code:
if (get_user_team(id) == CS_TEAM_SPECTATOR)     return PLUGIN_HANDLED;
Making the plugin source code easily readable, and thus easily maintainable.


All times are GMT -4. The time now is 21:55.

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