AlliedModders

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

vl@d 08-31-2007 08:26

maxplayers
 
I need a confirmation on what is maxplayers is cvar float, string?

_Master_ 08-31-2007 11:24

Re: maxplayers
 
int

On a side-note: all cvars are strings. They are converted to a specific type (other than string) by means of get_cvar_num(), get_cvar_float() or their pcvar counterparts. The initial type of the cvar is a string and is converted internally by get_[p]cvar_*() to the specified type.

vl@d 09-01-2007 06:52

Re: maxplayers
 
hmm.
Code:

Welcome to the AMX Mod X 1.76-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

Error: Argument type mismatch (argument 1) on line 34
Warning: Expression has no effect on line 34
Error: Expected token: ";", but found ")" on line 34
Error: Invalid expression, assumed zero on line 34
Error: Too many error messages on one line on line 34

Compilation aborted.
4 Errors.
Could not locate output file D:\cs\cstrike\addons\amxmodx\scripting\round_start_event.amx (compile failed).

Cand you give an ex.?

Alka 09-01-2007 06:59

Re: maxplayers
 
Post the code ... :S

vl@d 09-01-2007 10:20

Re: maxplayers
 
Code:

public round(id){
    new Players[32]
    new max_pl[32]
    new timeleft = get_timeleft()
    new playercount
    if(get_cvar_float("mp_roundtime") * 60.0)
    ++g_roundCount
    get_players(Players, playercount)
    get_pcvar_string("max_pl",maxplayers,31)
    ColorChat(0, BLUE, "[Runda %d Incepe Cu --> FF:%s | Jucatori On %d Din %d | Timpul Ramas:%d:%02d]",g_roundCount,get_cvar_num("mp_friendlyfire") ? "ON" : "OFF",Players,max_pl,timeleft / 60, timeleft % 60);   
    set_task(3.0,"round2",id,_,_,"a",1)
}

This is not all the code.

Alka 09-01-2007 10:29

Re: maxplayers
 
What a mess >.> :S , like this should look the code :

Code:

public round(id)
{
 new players[32], num;
 get_players(players, num);
 
 new max_players = get_maxplayers();
 new time_left = get_timeleft();
 
 g_roundCount += 1;
 
 ColorChat(0, BLUE, "[Runda %d Incepe Cu --> FF:%s | Jucatori On %d Din %d | Timpul Ramas:%d:%02d]", g_roundCount, get_cvar_num("mp_friendlyfire") ? "ON" : "OFF", num, max_players, time_left / 60, time_left % 60);
 
 set_task(3.0, "round2", id,_,_);
}


_Master_ 09-03-2007 02:34

Re: maxplayers
 
My guess is it will spam the chat and will mess up the round counter...


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

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