Raised This Month: $51 Target: $400
 12% 

Plugin REQ


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LESTRO
Member
Join Date: Jul 2017
Old 08-28-2017 , 05:37   Plugin REQ
Reply With Quote #1

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.

Last edited by LESTRO; 08-28-2017 at 05:39.
LESTRO is offline
LESTRO
Member
Join Date: Jul 2017
Old 09-09-2017 , 06:13   Re: Plugin REQ
Reply With Quote #2

If someone can make this for me, i can pay for it. Thank You!

Last edited by LESTRO; 09-09-2017 at 06:13.
LESTRO is offline
nhnkl159
Senior Member
Join Date: Jul 2012
Location: Israel 3>
Old 09-09-2017 , 07:27   Re: Plugin REQ
Reply With Quote #3

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

Last edited by nhnkl159; 09-09-2017 at 14:22.
nhnkl159 is offline
Send a message via Skype™ to nhnkl159
fraise
Member
Join Date: Sep 2016
Location: Paris, France
Old 09-09-2017 , 07:29   Re: Plugin REQ
Reply With Quote #4

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;

__________________
\o/
fraise is offline
LESTRO
Member
Join Date: Jul 2017
Old 09-09-2017 , 07:55   Re: Plugin REQ
Reply With Quote #5

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.
LESTRO is offline
fraise
Member
Join Date: Sep 2016
Location: Paris, France
Old 09-09-2017 , 07:55   Re: Plugin REQ
Reply With Quote #6

there is only Arena 1, or we have to guess where the player is ?
__________________
\o/
fraise is offline
nhnkl159
Senior Member
Join Date: Jul 2012
Location: Israel 3>
Old 09-09-2017 , 08:19   Re: Plugin REQ
Reply With Quote #7

Quote:
Originally Posted by LESTRO View Post
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.
__________________
nhnkl159 is offline
Send a message via Skype™ to nhnkl159
LESTRO
Member
Join Date: Jul 2017
Old 09-09-2017 , 08:35   Re: Plugin REQ
Reply With Quote #8

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.
LESTRO is offline
nhnkl159
Senior Member
Join Date: Jul 2012
Location: Israel 3>
Old 09-09-2017 , 08:58   Re: Plugin REQ
Reply With Quote #9

Quote:
Originally Posted by LESTRO View Post
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.
Attached Files
File Type: smx ScoreboardCountry.smx (4.8 KB, 91 views)
__________________
nhnkl159 is offline
Send a message via Skype™ to nhnkl159
LESTRO
Member
Join Date: Jul 2017
Old 09-09-2017 , 09:09   Re: Plugin REQ
Reply With Quote #10

Isn't working it's only the arena, no country.
LESTRO is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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