splewis / csgo-multi-1v1

CS:GO Sourcemod plugin to create multi-1v1 arena servers
GNU General Public License v3.0
278 stars 68 forks source link

Multi1v1_GetRoundTypeDisplayName doesn't work. #230

Open SurajBhari opened 5 years ago

SurajBhari commented 5 years ago
#include <sourcemod>
#include <multi1v1>
#include <cstrike>

public void OnPluginStart()
{
    HookEvent("round_start", Event_OnRoundStart);
}

public void Event_OnRoundStart(Handle event, const char[] name, bool dontBroadcast)
{
    for (new i = 1; i <= MaxClients; i++)
    {
        if(IsClientInGame(i) && !IsFakeClient(i))
        {
            PrintCenterText(i, " Hello ;-; " "Multi1v1_GetCurrentRoundType();
        }
    }
}

so i am not so good at coding and all , maybe cuz i am too young for it '=' so i just wanted a plugin which just tell which round is being played in their arena but its not working out can you just tell me whats wrong or maybe merge it

splewis commented 5 years ago

You probably want something like:

#include <sourcemod>
#include <multi1v1>
#include <cstrike>

public void Multi1v1_AfterPlayerSetup(int client) {
    int arena = Multi1v1_GetArenaNumber(client);
    if (arena > 0) {
        int roundType = Multi1v1_GetCurrentRoundType(arena);
        char roundTypeName[64];
        Multi1v1_GetRoundTypeDisplayName(roundType, roundTypeName, sizeof(roundTypeName));
        PrintCenterText(client, "Round type: %s", roundType);         
    } 
}
SurajBhari commented 5 years ago

It doesnt seem to work , no error in logs it just prints

Round type:

should be a problem with native itself

splewis commented 5 years ago

There could be a bug with it - but I don't see anything from quickly looking at the code.