AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Question about effiency (https://forums.alliedmods.net/showthread.php?t=156402)

Doc-Holiday 05-06-2011 02:30

Question about effiency
 
I use the native cs_get_user_team on every spawn and re spawn for my players as well as player death and in functions also called by the spawns.


So would it be more efficient to use an array in round_start looping the players and adding the "CS_TEAM_ID" to the array per player then accessing it to check each players team to give certain things?

or would it be better to use cs_get_user_team in like player spawn/death and then pass it to the different functions?

ConnorMcLeod 05-06-2011 02:33

Re: Question about effiency
 
Spawn / Respawn / Death are not called very often, i would stick with the native.

Doc-Holiday 05-06-2011 02:56

Re: Question about effiency
 
Quote:

Originally Posted by ConnorMcLeod (Post 1464041)
Spawn / Respawn / Death are not called very often, i would stick with the native.

Thanks..

PHP Code:

if(cs_get_user_team(id) == g_VIPteam && id != g_iVIPid);
{
      
ColorChat(idRED"[%s] ^4%s ^1is VIP this round. Stick together team!"PrefixNamevName);


How is that an Empty Statement

DarkGod 05-06-2011 05:17

Re: Question about effiency
 
; after if()

Doc-Holiday 05-06-2011 14:20

Re: Question about effiency
 
Quote:

Originally Posted by DarkGod (Post 1464121)
; after if()


LOL im blind.. i saw that when i woke... ive been trying to get this new mod done lol... good eye. im exhausted i havnt slept much.


All times are GMT -4. The time now is 04:27.

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