AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   if team is ct (https://forums.alliedmods.net/showthread.php?t=62051)

mazmaajinsh 10-17-2007 13:38

if team is ct
 
What to add to this code, so it will check if user team is CT? and if it isnt it wont work.
Code:

public timer_task() {
        for(new i=1;i<=get_maxplayers();i++) {
                if(is_user_connected(i) && is_user_alive(i) && showtimer[i-1] && timer_started[i-1]) {
                        new kreedztime = get_systime() - timer_time[i-1], imin
                        if((kreedztime / 60.0) >= 1) {
                                imin = floatround(kreedztime / 60.0,floatround_floor)
                                kreedztime -= (floatround(kreedztime / 60.0,floatround_floor) * 60)
                        }
                        set_hudmessage(255, 255, 255, -1.0, 0.05, 0, 0.0, 1.1, 0.0, 0.0, 1);
                        show_hudmessage(i, " %d min%s %d sec%s | %i CP ", imin,imin == 1 ? "" : "s",kreedztime,kreedztime == 1 ? "" : "s", checkpointnum[i-1]);

                }
        }
}


ConnorMcLeod 10-17-2007 13:49

Re: if team is ct
 
if(is_user_connected(i) && is_user_alive(i) && get_user_team(i) == 2 && showtimer[i-1] && timer_started[i-1]) {

mazmaajinsh 12-06-2007 20:36

Re: if team is ct
 
nope, i still can run the timer.. :(

Vet 12-07-2007 21:21

Re: if team is ct
 
If what connorr wrote doesn't work, then there must be something wrong with the showtimer[] or timer_started[] variable.

It'd be easier to T-shoot if you posted the whole code.


All times are GMT -4. The time now is 01:23.

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