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

[REQ] Point System


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 07-05-2013 , 11:19   [REQ] Point System
Reply With Quote #1

Hello
Can someone make point system that gives one point per kill?
If die etc dont remove points.
Also need rank and top15
With rank iam not talking about normal, expert, pro, etc, but numbers of him position.
I could make it but about rank and top15 i would fail like a retarded
__________________
Jhob94 is offline
Bobs
Member
Join Date: Oct 2011
Old 08-19-2013 , 12:06   Re: [REQ] Point System
Reply With Quote #2

My military rank system

-Bob
Attached Files
File Type: sma Get Plugin or Get Source (miliranksystem.sma - 588 views - 5.7 KB)
Bobs is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 08-19-2013 , 12:10   Re: [REQ] Point System
Reply With Quote #3

Old request and that isnt what i asked, i asked for rank and top15 not levels
__________________
Jhob94 is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 08-20-2013 , 16:01   Re: [REQ] Point System
Reply With Quote #4

So, do you still need it or not?
__________________
Kia is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 08-20-2013 , 16:18   Re: [REQ] Point System
Reply With Quote #5

well i am not but iam
Pm for more information because isnt for same thing that i requested
__________________
Jhob94 is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 08-20-2013 , 22:08   Re: [REQ] Point System
Reply With Quote #6

Quote:
Originally Posted by Jhob94 View Post
well i am not but iam
Pm for more information because isnt for same thing that i requested
I have a point stats, basiccaly i need to store a 3d array into a table for done this.

About position, if you need a top15 or 50 etc.. get by difference from kills to deaths.

See csstats.sma for formula it is easy
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
akash_guptacosmos
Senior Member
Join Date: May 2013
Location: India,Kolkata
Old 08-22-2013 , 05:37   Re: [REQ] Point System
Reply With Quote #7

Quote:
Originally Posted by Bobs View Post
My military rank system

-Bob
not works compile error
__________________
Quote:
Originally Posted by joropito View Post
I use orpheu to cook pizza
Like my page Please

https://www.facebook.com/LolXdTRolled
akash_guptacosmos is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 08-22-2013 , 07:35   Re: [REQ] Point System
Reply With Quote #8

He defined "RANKS" twice. Here is the fixed version :

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <nvault>
#include <colorchat>

new const VERSION[] = "2.0"
new const AUTHOR[]  = "Bob"
new const PLUGIN[]  = "Military Rank System"

new const RANKS[][]=
{
    
"[0/18] Private",
    
"[1/18] Private 1st Class",
    
"[2/18] Corporal",
    
"[3/18] Sergeant",
    
"[4/18] Staff Sergeant",
    
"[5/18] Sergeant 1st Class",
    
"[6/18] Master Sergeant",
    
"[7/18] Sergeant Major",
    
"[8/18] 2nd Lieutenant",
    
"[9/18] 1st Lieutenant",
    
"[10/18] Captain",
    
"[11/18] Major",
    
"[12/18] Lieutenant Colonel",
    
"[13/18] Colonel",
    
"[14/18] Brigadier General",
    
"[15/18] Major General",
    
"[16/18] Lieutenant General",
    
"[17/18] General",
    
"[18/18] General of the Army",
    
"Just to prevent Bug."
}

new const 
KILLS[] =
{
    
0,
    
25,
    
50,
    
100,
    
250,
    
400,
    
525,
    
650,
    
800,
    
1000,
    
1250,
    
1600,
    
2000,
    
2500,
    
3100,
    
3700,
    
4100,
    
4500,
    
5000,
    
99999
}

#define HUD_INTERVAL    1.0

new cvar_killscvar_hskills
new cached_killscached_hskills
new g_vaultg_status_sync
new iKills[33], iRANKS[33]
new 
iKilled[33][33]
new 
name[33][32], iSteamID[33][32]

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_cvar("mr_on""1")
    
    
register_clcmd("say /rank""show_stats")
    
register_clcmd("say_team /rank""show_stats")
    
    
cvar_kills register_cvar("mr_rank_kills""1")
    
cvar_hskills register_cvar("mr_rank_hskills""1")
    
    
register_event("StatusValue""showStatus""be""1=2""2!0")
    
register_event("StatusValue""hideStatus""be""1=1""2=0")
    
register_event("DeathMsg""event_DeathMsg""a""1>0")
    
    
set_task(HUD_INTERVAL"ShowHud"0)
    
    
g_vault nvault_open("vault_rank")
    
g_status_sync CreateHudSyncObj();
    
    if(
g_vault == INVALID_HANDLE)
    {
        
set_fail_state("Error")
    }
}

public 
plugin_end()
{
    new 
iPlayers[32], iNum
    get_players
(iPlayersiNum)
    
    new 
iPlayer
    
for(new 0iNumi++)
    {
        
iPlayer iPlayers[i]
        
        
SaveData(iPlayer)
    }
    
nvault_close(g_vault)
}

public 
client_connect(id)
{
    
LoadData(id)
}

public 
client_putinserver(id)
{
    
get_user_authid(idiSteamID[id], 31)
    
    
set_task(HUD_INTERVAL"ShowHud"id)
    
    
LoadData(id)
}

public 
client_disconnect(id)
{
    
SaveData(id)
}

public 
showStatus(id)
{
    if(!
is_user_bot(id) && is_user_connected(id)) 
    {
        new 
name[32]
        new 
pid read_data(2)
        
get_user_name(pidname31)
        
        new 
color1 0
        
new color2 0
    
        
new team1 get_user_team(id), team2 get_user_team(pid)
    
        if (
team2 == 1)
        {
            
color1 200
        
}
        else
        {
            
color2 200
        
}
                
        if(
team1 == team2)
        {
            
set_hudmessage(color150color2, -1.00.6010.013.00.010.01, -1)
            
ShowSyncHudMsg(idg_status_sync"Name: %s^nHealth: %d^nRank: %s | Kills: %d"nameget_user_health(pid), iRANKS[iRANKS[pid]], iKills[pid])
        }
        else
        {
            
set_hudmessage(color150color2, -1.00.6010.013.00.010.01, -1)
            
ShowSyncHudMsg(idg_status_sync"Name: %s^nHealth: %d^nRank: %s | Kills: %d"nameget_user_health(pid), iRANKS[iRANKS[pid]], iKills[pid])
        }
    }
}

public 
hideStatus(id)
{
    
ClearSyncHud(idg_status_sync)
}

public 
ShowHud(id)
{
    if(!
is_user_connected(id))
        return 
0
    
    
if(is_user_alive(id))
    {
        
client_print(idprint_center"Rank: %s | Kills: %d / %d"iRANKS[iRANKS[id]], iKills[id], KILLS[iRANKS[id] + 1])
    }
    
    
set_task(HUD_INTERVAL,"ShowHud"id
    
    return 
PLUGIN_CONTINUE
}

public 
show_stats(id)
{
    if(
is_user_connected(id))
    {
        
get_user_name(idname[id], 31)
        
ColorChat(0GREEN"^x04[T.D] ^x03%s's ^x01Rank: ^x04%s ^x01 | with: ^x04%d ^x01kill(s) | Next rank: ^x04%d ^x01kill(s)!"name[id], iRANKS[iRANKS[id]], iKills[id], KILLS[iRANKS[id] + 1] - iKills[id])
    }
}

public 
event_DeathMsg()
{
    static 
iKilleriKiller read_data(1)
    static 
iVictimiVictim read_data(2)
    static 
iIsHeadshotiIsHeadshot read_data(3)
    
    
cached_kills get_pcvar_num(cvar_kills)
    
cached_hskills get_pcvar_num(cvar_hskills)
    
    if(
iVictim == iKiller)
        return 
PLUGIN_CONTINUE
    
    
if(iIsHeadshot)
    {    
        
iKilled[iKiller][iVictim] = true
        iKills
[iKiller] += cached_hskills
        ColorChat
(iKillerGREEN"^x04[T.D] ^x01You got^x04 1 ^x01Kill Point for killing an enemy!")
    }
    else
    {
        
iKilled[iKiller][iVictim] = true
        iKills
[iKiller] += cached_kills
        ColorChat
(iKillerGREEN"^x04[T.D] ^x01You got^x04 1 ^x01Kill Point for killing an enemy!")
    }
        
    while((
iKills[iKiller] >= KILLS[iRANKS[iKiller] + 1] && iRANKS[iKiller] < 18))
    {
        
iRANKS[iKiller] += 1
        
        
new szName[32]
        
get_user_name(iKillerszNamecharsmax(szName))
        
        
ColorChat(0GREEN"^x04[T.D] %s's ^x01Rank is now: ^x04%s^x01!"szNameiRANKS[iRANKS[iKiller]])
    }

    
SaveData(iKiller)
    
set_task(HUD_INTERVAL,"ShowHud"iKiller)
    
    return 
PLUGIN_CONTINUE
}

public 
SaveData(id)
{
    new 
authid[32]
    
get_user_authid(idauthid31)

    new 
vaultkey[64], vaultdata[64
  
    
format(vaultkey63"MILITARYv2-%s-rank"authid)
    
format(vaultdata63"%d"RANKS[id])
    
set_vaultdata(vaultkeyvaultdata)

    
format(vaultkey63"MILITARYv2-%s-kills"authid)
    
format(vaultdata63"%d"iKills[id])
    
set_vaultdata(vaultkeyvaultdata)
}

public 
LoadData(id)
{
    new 
authid[32]
    
get_user_authid(idauthid31)

    new 
vaultkey[64], vaultdata[64]

    
format(vaultkey63"MILITARYv2-%s-rank"authid)
    
get_vaultdata(vaultkeyvaultdata63)
    
iRANKS[id] = str_to_num(vaultdata)

    
format(vaultkey63"MILITARYv2-%s-kills"authid)
    
get_vaultdata(vaultkeyvaultdata63)
    
iKills[id] = str_to_num(vaultdata)

__________________
Kia is offline
akash_guptacosmos
Senior Member
Join Date: May 2013
Location: India,Kolkata
Old 08-23-2013 , 05:35   Re: [REQ] Point System
Reply With Quote #9

Quote:
Originally Posted by Kia View Post
He defined "RANKS" twice. Here is the fixed version :

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <nvault>
#include <colorchat>

new const VERSION[] = "2.0"
new const AUTHOR[]  = "Bob"
new const PLUGIN[]  = "Military Rank System"

new const RANKS[][]=
{
    
"[0/18] Private",
    
"[1/18] Private 1st Class",
    
"[2/18] Corporal",
    
"[3/18] Sergeant",
    
"[4/18] Staff Sergeant",
    
"[5/18] Sergeant 1st Class",
    
"[6/18] Master Sergeant",
    
"[7/18] Sergeant Major",
    
"[8/18] 2nd Lieutenant",
    
"[9/18] 1st Lieutenant",
    
"[10/18] Captain",
    
"[11/18] Major",
    
"[12/18] Lieutenant Colonel",
    
"[13/18] Colonel",
    
"[14/18] Brigadier General",
    
"[15/18] Major General",
    
"[16/18] Lieutenant General",
    
"[17/18] General",
    
"[18/18] General of the Army",
    
"Just to prevent Bug."
}

new const 
KILLS[] =
{
    
0,
    
25,
    
50,
    
100,
    
250,
    
400,
    
525,
    
650,
    
800,
    
1000,
    
1250,
    
1600,
    
2000,
    
2500,
    
3100,
    
3700,
    
4100,
    
4500,
    
5000,
    
99999
}

#define HUD_INTERVAL    1.0

new cvar_killscvar_hskills
new cached_killscached_hskills
new g_vaultg_status_sync
new iKills[33], iRANKS[33]
new 
iKilled[33][33]
new 
name[33][32], iSteamID[33][32]

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_cvar("mr_on""1")
    
    
register_clcmd("say /rank""show_stats")
    
register_clcmd("say_team /rank""show_stats")
    
    
cvar_kills register_cvar("mr_rank_kills""1")
    
cvar_hskills register_cvar("mr_rank_hskills""1")
    
    
register_event("StatusValue""showStatus""be""1=2""2!0")
    
register_event("StatusValue""hideStatus""be""1=1""2=0")
    
register_event("DeathMsg""event_DeathMsg""a""1>0")
    
    
set_task(HUD_INTERVAL"ShowHud"0)
    
    
g_vault nvault_open("vault_rank")
    
g_status_sync CreateHudSyncObj();
    
    if(
g_vault == INVALID_HANDLE)
    {
        
set_fail_state("Error")
    }
}

public 
plugin_end()
{
    new 
iPlayers[32], iNum
    get_players
(iPlayersiNum)
    
    new 
iPlayer
    
for(new 0iNumi++)
    {
        
iPlayer iPlayers[i]
        
        
SaveData(iPlayer)
    }
    
nvault_close(g_vault)
}

public 
client_connect(id)
{
    
LoadData(id)
}

public 
client_putinserver(id)
{
    
get_user_authid(idiSteamID[id], 31)
    
    
set_task(HUD_INTERVAL"ShowHud"id)
    
    
LoadData(id)
}

public 
client_disconnect(id)
{
    
SaveData(id)
}

public 
showStatus(id)
{
    if(!
is_user_bot(id) && is_user_connected(id)) 
    {
        new 
name[32]
        new 
pid read_data(2)
        
get_user_name(pidname31)
        
        new 
color1 0
        
new color2 0
    
        
new team1 get_user_team(id), team2 get_user_team(pid)
    
        if (
team2 == 1)
        {
            
color1 200
        
}
        else
        {
            
color2 200
        
}
                
        if(
team1 == team2)
        {
            
set_hudmessage(color150color2, -1.00.6010.013.00.010.01, -1)
            
ShowSyncHudMsg(idg_status_sync"Name: %s^nHealth: %d^nRank: %s | Kills: %d"nameget_user_health(pid), iRANKS[iRANKS[pid]], iKills[pid])
        }
        else
        {
            
set_hudmessage(color150color2, -1.00.6010.013.00.010.01, -1)
            
ShowSyncHudMsg(idg_status_sync"Name: %s^nHealth: %d^nRank: %s | Kills: %d"nameget_user_health(pid), iRANKS[iRANKS[pid]], iKills[pid])
        }
    }
}

public 
hideStatus(id)
{
    
ClearSyncHud(idg_status_sync)
}

public 
ShowHud(id)
{
    if(!
is_user_connected(id))
        return 
0
    
    
if(is_user_alive(id))
    {
        
client_print(idprint_center"Rank: %s | Kills: %d / %d"iRANKS[iRANKS[id]], iKills[id], KILLS[iRANKS[id] + 1])
    }
    
    
set_task(HUD_INTERVAL,"ShowHud"id
    
    return 
PLUGIN_CONTINUE
}

public 
show_stats(id)
{
    if(
is_user_connected(id))
    {
        
get_user_name(idname[id], 31)
        
ColorChat(0GREEN"^x04[T.D] ^x03%s's ^x01Rank: ^x04%s ^x01 | with: ^x04%d ^x01kill(s) | Next rank: ^x04%d ^x01kill(s)!"name[id], iRANKS[iRANKS[id]], iKills[id], KILLS[iRANKS[id] + 1] - iKills[id])
    }
}

public 
event_DeathMsg()
{
    static 
iKilleriKiller read_data(1)
    static 
iVictimiVictim read_data(2)
    static 
iIsHeadshotiIsHeadshot read_data(3)
    
    
cached_kills get_pcvar_num(cvar_kills)
    
cached_hskills get_pcvar_num(cvar_hskills)
    
    if(
iVictim == iKiller)
        return 
PLUGIN_CONTINUE
    
    
if(iIsHeadshot)
    {    
        
iKilled[iKiller][iVictim] = true
        iKills
[iKiller] += cached_hskills
        ColorChat
(iKillerGREEN"^x04[T.D] ^x01You got^x04 1 ^x01Kill Point for killing an enemy!")
    }
    else
    {
        
iKilled[iKiller][iVictim] = true
        iKills
[iKiller] += cached_kills
        ColorChat
(iKillerGREEN"^x04[T.D] ^x01You got^x04 1 ^x01Kill Point for killing an enemy!")
    }
        
    while((
iKills[iKiller] >= KILLS[iRANKS[iKiller] + 1] && iRANKS[iKiller] < 18))
    {
        
iRANKS[iKiller] += 1
        
        
new szName[32]
        
get_user_name(iKillerszNamecharsmax(szName))
        
        
ColorChat(0GREEN"^x04[T.D] %s's ^x01Rank is now: ^x04%s^x01!"szNameiRANKS[iRANKS[iKiller]])
    }

    
SaveData(iKiller)
    
set_task(HUD_INTERVAL,"ShowHud"iKiller)
    
    return 
PLUGIN_CONTINUE
}

public 
SaveData(id)
{
    new 
authid[32]
    
get_user_authid(idauthid31)

    new 
vaultkey[64], vaultdata[64
  
    
format(vaultkey63"MILITARYv2-%s-rank"authid)
    
format(vaultdata63"%d"RANKS[id])
    
set_vaultdata(vaultkeyvaultdata)

    
format(vaultkey63"MILITARYv2-%s-kills"authid)
    
format(vaultdata63"%d"iKills[id])
    
set_vaultdata(vaultkeyvaultdata)
}

public 
LoadData(id)
{
    new 
authid[32]
    
get_user_authid(idauthid31)

    new 
vaultkey[64], vaultdata[64]

    
format(vaultkey63"MILITARYv2-%s-rank"authid)
    
get_vaultdata(vaultkeyvaultdata63)
    
iRANKS[id] = str_to_num(vaultdata)

    
format(vaultkey63"MILITARYv2-%s-kills"authid)
    
get_vaultdata(vaultkeyvaultdata63)
    
iKills[id] = str_to_num(vaultdata)

This time less error but still getting errors :S
__________________
Quote:
Originally Posted by joropito View Post
I use orpheu to cook pizza
Like my page Please

https://www.facebook.com/LolXdTRolled
akash_guptacosmos is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 08-23-2013 , 05:38   Re: [REQ] Point System
Reply With Quote #10

I get none, post yours.
__________________
Kia 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:25.


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