Raised This Month: $ Target: $400
 0% 

[REQ] Player Kill Get Points


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alferd
Veteran Member
Join Date: Dec 2019
Location: Iran is Always Eternal
Old 04-28-2020 , 15:05   [REQ] Player Kill Get Points
Reply With Quote #1

I want a plugin. When a player kills someone, he receives 2 "points" ( "Points" are saved )

If possible, do this on the plugin below
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <points>
#include <hamsandwich>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

#define HUD    1574

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Spawn"player""ShowHud"1)
}

public 
ShowHud(id);
{
    
id -= HUD;
    
    new 
iPoints Collector_GetPlayerPoints(id);
    
    
set_hudmessage(010400.010.5506.01.0);
    
show_hudmessage(id"Your Points : %d"iPoints);
    
    
set_task(0.0"ShowHud"id HUD);

points.inc
PHP Code:
native Collector_GetPlayerPoints(id);
native Collector_SetPlayerPoints(idcount); 
:

Last edited by alferd; 04-28-2020 at 15:06.
alferd is offline
MagNNusS
Member
Join Date: May 2018
Location: World of Bushi
Old 04-28-2020 , 15:52   Re: [REQ] Player Kill Get Points
Reply With Quote #2

Spoiler


P.S Not tested.
__________________
Just an impractical signature
nothing to see here.
MagNNusS is offline
AceVentura
Member
Join Date: Mar 2020
Location: Ontario, Canada
Old 04-28-2020 , 15:54   Re: [REQ] Player Kill Get Points
Reply With Quote #3

Hm, this below is part from a plugin i use, edited few things for you.
It saves points on SteamID.

PHP Code:
#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < nvault >

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

#define UPDATE_INTERVAL     1.0

new  g_BonusKillg_nVaultg_aClientPoints32 ]

new 
gHudSync;

public 
plugin_init( ) 
{
    
register_pluginPLUGINVERSIONAUTHOR )
    
    
register_event("DeathMsg""eDeath""a")
    
    
g_BonusKill register_cvar"points_per_kill""2" )
    
    
g_nVault nvault_open"Clients_Points" )
    
    
set_taskUPDATE_INTERVAL"UpdatePoints"___"b" );
    
    
gHudSync CreateHudSyncObj( ); 
}

public 
client_putinserverid )
{
    
g_aClientPointsid ] = 0
    LoadPoints
id )
}


public 
eDeath(  ) {
    
    new 
attacker read_data)
    new 
victim read_data)
    
    new 
victim_name32 ];
    
get_user_namevictimvictim_namecharsmaxvictim_name ) )
    
    if( 
cs_get_user_teamattacker ) != cs_get_user_teamvictim ) )
    {
        
g_aClientPointsattacker ] += get_pcvar_numg_BonusKill )
        
client_printattackerprint_chat"+ %d points for killing %s"get_pcvar_numg_BonusKill ), victim_name )
        
SavePointsattacker )
        
UpdatePointsattacker )
    }
    
    return 
PLUGIN_HANDLED;
}


public 
SavePointsid )
{
    new 
szAuthid32 ]
    
get_user_authididszAuthidcharsmaxszAuthid ) )
    
    new 
vaultkey[64],vaultdata[256]
    
formatvaultkeycharsmaxvaultkey ), "%s"szAuthid )
    
formatvaultdata,charsmaxvaultdata),"%i#",g_aClientPointsid ])
    
nvault_setg_nVaultvaultkeyvaultdata )
}

public 
LoadPointsid )
{
    new 
szAuthid32 ]
    
get_user_authididszAuthidcharsmaxszAuthid ) )
    
    new 
vaultkey64 ],vaultdata256 ]
    
formatvaultkeycharsmaxvaultkey ),"%s"szAuthid )
    
formatvaultdatacharsmaxvaultdata),"%i#"g_aClientPointsid ] )
    
nvault_getg_nVaultvaultkeyvaultdata,charsmaxvaultdata ) )
    
    
replace_allvaultdatacharsmaxvaultdata ), "#"" " )
    
    new 
playerpoints32 ]
    
    
parsevaultdataplayerpointscharsmaxplayerpoints ) )
    
    
g_aClientPointsid ] = str_to_numplayerpoints )
}

public 
UpdatePointsid ) {
    
    
    new 
iPlayers32 ], iNumid;
    
get_playersiPlayersiNum );
    
    
    for( new 
iiNumi++ )
    {
        
id iPlayers]
        if (
is_user_aliveid ) )
        {
            
set_hudmessage010400.010.5506.0UPDATE_INTERVAL 0.1 ); 
            
ShowSyncHudMsgidgHudSync"Points: %d "g_aClientPoints[id] ); 
        }
        
    }
    return 
PLUGIN_HANDLED;

Hope i helped.

Screenshot: https://prnt.sc/s7l6d0
__________________
So.. animals CAN sense evil!
AceVentura is offline
alferd
Veteran Member
Join Date: Dec 2019
Location: Iran is Always Eternal
Old 04-29-2020 , 03:39   Re: [REQ] Player Kill Get Points
Reply With Quote #4

Quote:
Originally Posted by AceVentura View Post
Hm, this below is part from a plugin i use, edited few things for you.
It saves points on SteamID.

PHP Code:
#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < nvault >

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

#define UPDATE_INTERVAL     1.0

new  g_BonusKillg_nVaultg_aClientPoints32 ]

new 
gHudSync;

public 
plugin_init( ) 
{
    
register_pluginPLUGINVERSIONAUTHOR )
    
    
register_event("DeathMsg""eDeath""a")
    
    
g_BonusKill register_cvar"points_per_kill""2" )
    
    
g_nVault nvault_open"Clients_Points" )
    
    
set_taskUPDATE_INTERVAL"UpdatePoints"___"b" );
    
    
gHudSync CreateHudSyncObj( ); 
}

public 
client_putinserverid )
{
    
g_aClientPointsid ] = 0
    LoadPoints
id )
}


public 
eDeath(  ) {
    
    new 
attacker read_data)
    new 
victim read_data)
    
    new 
victim_name32 ];
    
get_user_namevictimvictim_namecharsmaxvictim_name ) )
    
    if( 
cs_get_user_teamattacker ) != cs_get_user_teamvictim ) )
    {
        
g_aClientPointsattacker ] += get_pcvar_numg_BonusKill )
        
client_printattackerprint_chat"+ %d points for killing %s"get_pcvar_numg_BonusKill ), victim_name )
        
SavePointsattacker )
        
UpdatePointsattacker )
    }
    
    return 
PLUGIN_HANDLED;
}


public 
SavePointsid )
{
    new 
szAuthid32 ]
    
get_user_authididszAuthidcharsmaxszAuthid ) )
    
    new 
vaultkey[64],vaultdata[256]
    
formatvaultkeycharsmaxvaultkey ), "%s"szAuthid )
    
formatvaultdata,charsmaxvaultdata),"%i#",g_aClientPointsid ])
    
nvault_setg_nVaultvaultkeyvaultdata )
}

public 
LoadPointsid )
{
    new 
szAuthid32 ]
    
get_user_authididszAuthidcharsmaxszAuthid ) )
    
    new 
vaultkey64 ],vaultdata256 ]
    
formatvaultkeycharsmaxvaultkey ),"%s"szAuthid )
    
formatvaultdatacharsmaxvaultdata),"%i#"g_aClientPointsid ] )
    
nvault_getg_nVaultvaultkeyvaultdata,charsmaxvaultdata ) )
    
    
replace_allvaultdatacharsmaxvaultdata ), "#"" " )
    
    new 
playerpoints32 ]
    
    
parsevaultdataplayerpointscharsmaxplayerpoints ) )
    
    
g_aClientPointsid ] = str_to_numplayerpoints )
}

public 
UpdatePointsid ) {
    
    
    new 
iPlayers32 ], iNumid;
    
get_playersiPlayersiNum );
    
    
    for( new 
iiNumi++ )
    {
        
id iPlayers]
        if (
is_user_aliveid ) )
        {
            
set_hudmessage010400.010.5506.0UPDATE_INTERVAL 0.1 ); 
            
ShowSyncHudMsgidgHudSync"Points: %d "g_aClientPoints[id] ); 
        }
        
    }
    return 
PLUGIN_HANDLED;

Hope i helped.

Screenshot: https://prnt.sc/s7l6d0
Unfortunately, it didn't solve my problem

Quote:
Originally Posted by MagNNusS View Post
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <points>
#include <hamsandwich>

#define is_user_valide(%0)      bool:( 1 <= %0 <= getmaxplayers)

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

#define HUD    1574

// how much points should player get per a kill
#define POINTS_PER_KILL     2

new getmaxplayers

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);

    
RegisterHam(Ham_Spawn"player""ShowHud"1);
    
register_event("DeathMsg""DeathMsg""a");

    
getmaxplayers get_maxplayers();
}

public 
ShowHud(id)
{
    
id -= HUD;

    new 
iPoints Collector_GetPlayerPoints(id);

    
set_hudmessage(010400.010.5506.01.0);
    
show_hudmessage(id"Your Points : %d"iPoints);

    
set_task(0.0"ShowHud"id HUD);
}
public 
DeathMsg()
{
    new 
killer read_data(1);
    new 
victim read_data(2);

    if(!(
is_user_valide(victim)) || !(is_user_valide(killer)))
        return 
PLUGIN_HANDLED;

    if(
is_user_alive(victim) || !(is_user_alive(killer)))
        return 
PLUGIN_HANDLED;

    if(
killer == victim)
        return 
PLUGIN_HANDLED;

    
Collector_SetPlayerPoints(killerCollector_GetPlayerPoints(killer) + POINTS_PER_KILL);
    return 
PLUGIN_HANDLED;

P.S Not tested.
This plugin seems to work but does not save points
alferd is offline
alferd
Veteran Member
Join Date: Dec 2019
Location: Iran is Always Eternal
Old 04-30-2020 , 06:54   Re: [REQ] Player Kill Get Points
Reply With Quote #5

No one has a better idea??
alferd is offline
MagNNusS
Member
Join Date: May 2018
Location: World of Bushi
Old 04-30-2020 , 09:44   Re: [REQ] Player Kill Get Points
Reply With Quote #6

Quote:
Originally Posted by alferd View Post
This plugin seems to work but does not save points
Oh, i didn't knew you also asked to save players points.

Quote:
Originally Posted by alferd View Post
No one has a better idea??
Gently don't bump, you should wait some days than you can 'bump' your thread.

Spoiler


Not tested.
__________________
Just an impractical signature
nothing to see here.
MagNNusS is offline
alferd
Veteran Member
Join Date: Dec 2019
Location: Iran is Always Eternal
Old 04-30-2020 , 10:53   Re: [REQ] Player Kill Get Points
Reply With Quote #7

Quote:
Originally Posted by MagNNusS View Post
Oh, i didn't knew you also asked to save players points.


Gently don't bump, you should wait some days than you can 'bump' your thread.

Spoiler


Not tested.
Thanks a lot
alferd is offline
alferd
Veteran Member
Join Date: Dec 2019
Location: Iran is Always Eternal
Old 04-30-2020 , 15:18   Re: [REQ] Player Kill Get Points
Reply With Quote #8

Code:
[AMXX] Plugin "points.amxx" failed to load: Plugin uses an unknown function (name "Collectro_Set_PlayerPoints") - check your modules.ini.
Code:
]amxx plugins

( 22) Load fails: Plugin uses an unknown function (name "Collector_SetPlayerPoints") - check your modules.ini.
??

Last edited by alferd; 04-30-2020 at 15:41.
alferd is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-30-2020 , 17:33   Re: [REQ] Player Kill Get Points
Reply With Quote #9

Quote:
Originally Posted by alferd View Post
Code:
[AMXX] Plugin "points.amxx" failed to load: Plugin uses an unknown function (name "Collectro_Set_PlayerPoints") - check your modules.ini.
Code:
]amxx plugins

( 22) Load fails: Plugin uses an unknown function (name "Collector_SetPlayerPoints") - check your modules.ini.
??
Try adding the points include in your scripting\include folder of your server, that might be the problem.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
alferd
Veteran Member
Join Date: Dec 2019
Location: Iran is Always Eternal
Old 05-01-2020 , 02:19   Re: [REQ] Player Kill Get Points
Reply With Quote #10

Quote:
Originally Posted by Napoleon_be View Post
Try adding the points include in your scripting\include folder of your server, that might be the problem.
You mean that??

points.inc
alferd 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 23:56.


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