Raised This Month: $ Target: $400
 0% 

CS:GO ranking for 1v1 Arena


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 01-06-2016 , 13:35   Re: CS:GO ranking for 1v1 Arena
Reply With Quote #1

There we go ! The solution with little explication :
PHP Code:
#include <sourcemod>  
#include <sdktools> 
#include <cstrike> 
#include <multi1v1> //-----------> Point 1

int ScorePlayer[MAXPLAYERS+1];

public 
Plugin myinfo =  

    
name "Ranking Arena"
    
author "Janek"
    
description "Ranking na Arene. Credits:splewis, Arkarr"
    
version "1.0"
    
url "http://www.cs-serwer.pl/" 


public 
OnPluginStart() 

    
HookEvent("player_death"Event_OnPlayerDeath); //-----------> point 2 (hook event)
}  

//------------> point 2
public Action Event_OnPlayerDeath(Event event,const char[] namebool dontBroadcast)
{
    
int ArenaLooser GetClientOfUserId(event.GetInt("userid"));
    
int ArenaWinner GetClientOfUserId(event.GetInt("attacker"));
    
    
//------------> Point 3
    
if(Multi1v1_GetOpponent(ArenaWinner) == -1
        return 
Plugin_Continue;
    
    
// ------> point 4
    
int ArenaNumber Multi1v1_GetArenaNumber(ArenaWinner);

    
    
ScorePlayer[ArenaWinner] += ArenaNumber;
    
ScorePlayer[ArenaLooser] -= ArenaNumber;
    
    
PrintToChatAll("[Arena Points] %N won and got +%i points ! (%i)"ArenaWinnerArenaNumberScorePlayer[ArenaWinner]);
    
PrintToChatAll("[Arena Points] %N lost and lost -%i points ! (%i)"ArenaWinnerArenaNumberScorePlayer[ArenaLooser]);
    
    return 
Plugin_Continue;

__________________
Want to check my plugins ?
Arkarr 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 04:36.


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