AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   Plugin REQ (https://forums.alliedmods.net/showthread.php?t=300749)

LESTRO 08-28-2017 05:37

Plugin REQ
 
Hello. I want a plugin for multi1v1 plugin which shows you which country you are on the scorebord, like this: Arena 1 | UK. If you can make this plugin i will be very happy.
Thank you in advance.

LESTRO 09-09-2017 06:13

Re: Plugin REQ
 
If someone can make this for me, i can pay for it. Thank You!

nhnkl159 09-09-2017 07:27

Re: Plugin REQ
 
PHP Code:

#pragma semicolon 1

#define DEBUG

#define PLUGIN_AUTHOR "nhnkl159"
#define PLUGIN_VERSION "1.0"

#include <sourcemod>
#include <sdktools>
#include <geoip>
#include <cstrike>
#include <multi1v1>

ConVar gS_Enabled;

public 
Plugin myinfo 
{
    
name "[CS:GO] Scoreboard Country"
    
author PLUGIN_AUTHOR
    
description "Add [Country] tag to the player near his name."
    
version PLUGIN_VERSION
    
url "keepomod.com"
};

public 
void OnPluginStart()
{
    
// === ConVars === //
    
gS_Enabled CreateConVar("sm_scoreboardcountry_enable""1""Sets whether or not to set player name");
    
    
HookEvent("player_spawn"Event_PlayerSpawnEventHookMode_Post);
    
HookUserMessage(GetUserMessageId("SayText2"), UserMessageHook_SayText2true);
    
}
public 
Action UserMessageHook_SayText2(UserMsg msg_hdHandle bf, const int [] playersint playersNumbool reliablebool init)
{
    if(!
reliable)
    {
        return 
Plugin_Continue;
    }

    
char gS_buffer[25];

    if(
GetUserMessageType() == UM_Protobuf// CSGO
    
{
        
PbReadString(bf"msg_name"gS_buffersizeof(gS_buffer));

        if(
StrEqual(gS_buffer"#Cstrike_Name_Change"))
        {
            return 
Plugin_Handled;
        }
    }
    return 
Plugin_Continue;
}  

public 
void Event_PlayerSpawn(Event e, const char[] namebool dontBroadcast)
{
    if (
gS_Enabled.BoolValue)
    {
        
int client GetClientOfUserId(GetEventInt(e"userid"));
        if (
IsValidClient(client) && Multi1v1_IsInArena(client))
        {
            
CreateTimer(0.5SetTag_TimerclientTIMER_FLAG_NO_MAPCHANGE);
        }
    }
}


public 
Action SetTag_Timer(Handle Timerany client)
{
    
char gS_IP[14], gS_Country[3], gS_Shit[32], gS_PlayerName[MAX_NAME_LENGTH];
    
GetClientIP(clientgS_IP14);
    
GetClientName(clientgS_PlayerNameMAX_NAME_LENGTH);
    
GeoipCode2(gS_IPgS_Country);
    if (
GeoipCode2(gS_IPgS_Country))
    {
        
FormatEx(gS_Shit32"Arena %d | %s | %s"Multi1v1_GetArenaNumber(client), gS_CountrygS_PlayerName);
    }
    else
    {
        
FormatEx(gS_Shit32"Arena %d | -- | %s"Multi1v1_GetArenaNumber(client), gS_PlayerName);
    }
    
SetClientName(clientgS_Shit);
    
CS_SetClientClanTag(client"");
}

stock bool IsValidClient(int clientbool alive falsebool bots false)
{
    if (
client && client <= MaxClients && IsClientInGame(client) && (alive == false || IsPlayerAlive(client)) && (bots == false && !IsFakeClient(client)))
    {
        return 
true;
    }
    return 
false;


This should work :)

fraise 09-09-2017 07:29

Re: Plugin REQ
 
or here, if you want =)

PHP Code:

#include <sourcemod>
#include <geoip>
#include <cstrike>
bool toggle;
public 
void OnPluginStart()
{
    
RegAdminCmd("sm_country"toggle_countryADMFLAG_ROOT);
}
public 
OnClientAuthorized(client, const String:szAuthId[])
{
    if(!
toggle)
        return;
        
        
char ip[16];
        
char loc[3];
        
GetClientIP(clientipsizeof(ip));
        if(
GeoipCode2(iploc))
        {
            
CS_SetClientClanTag(clientloc); 
        }
}
public 
Action toggle_country(int clientint args)
{
    if(
toggle)
        
toggle=false;
    else if(!
toggle)
        
toggle=true;



LESTRO 09-09-2017 07:55

Re: Plugin REQ
 
Isn't working, it looks like this: [UK] Name and i don't like this, i want: Arena 1 | UK, for multi 1v1 plugin, the arena and the country: Arena 1 | UK Your Name.

fraise 09-09-2017 07:55

Re: Plugin REQ
 
there is only Arena 1, or we have to guess where the player is ?

nhnkl159 09-09-2017 08:19

Re: Plugin REQ
 
Quote:

Originally Posted by LESTRO (Post 2547696)
Isn't working, it looks like this: [UK] Name and i don't like this, i want: Arena 1 | UK, for multi 1v1 plugin, the arena and the country: Arena 1 | UK Your Name.

Edited my post, check out the new source.

LESTRO 09-09-2017 08:35

Re: Plugin REQ
 
Okey. Thank yiu, but the plugin failed to compile: SourcePawn Compiler 1.7.1
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2014 AlliedModders LLC

/home/groups/sourcemod/upload_tmp/phpGUAiTf.sp(12) : fatal error 182: cannot read from file: "multi1v1"

Compilation aborted.
1 Error.

If you can compile it for me, i will be very happy.

nhnkl159 09-09-2017 08:58

Re: Plugin REQ
 
1 Attachment(s)
Quote:

Originally Posted by LESTRO (Post 2547708)
Okey. Thank yiu, but the plugin failed to compile: SourcePawn Compiler 1.7.1
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2014 AlliedModders LLC

/home/groups/sourcemod/upload_tmp/phpGUAiTf.sp(12) : fatal error 182: cannot read from file: "multi1v1"

Compilation aborted.
1 Error.

If you can compile it for me, I will be very happy.

Download the inc from here: https://raw.githubusercontent.com/sp...e/multi1v1.inc

But I've attached the compiled version.

LESTRO 09-09-2017 09:09

Re: Plugin REQ
 
Isn't working it's only the arena, no country. :(


All times are GMT -4. The time now is 11:13.

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