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

ResetScore


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
El Abuelo Loco
Senior Member
Join Date: Jun 2020
Old 11-23-2020 , 18:29   ResetScore
Reply With Quote #1

Can someone tell me how I can add that he can reset his score in the next round? because if they reset it many times they saturate the being...

PHP Code:
#include <amxmodx>
#include <fun>
#include <cstrike>

new const PLUGIN_NAME[]  = "Reset_Score";
new const 
VERSION[] = "1.0";
new const 
AUTHOR[]  = "Silenttt Fixed by 9 rpamm!?";

new 
name[33];
new 
rs_hudmessage;
new 
rs_sound;
 
public 
plugin_init()
{
    
register_pluginPLUGIN_NAMEVERSIONAUTHOR );

    
register_clcmd("say /rs""reset_score");
    
register_clcmd("say /resetscore""reset_score");
    
    
rs_hudmessage register_cvar("rs_hudmessage""1");
    
rs_sound register_cvar("rs_sound""1");
}

public 
reset_score(id)
{
    
set_user_frags(id0);
    
cs_set_user_deaths(id0);

    if(
get_pcvar_num(rs_hudmessage))
    {
        
get_user_name(idname32);
        
set_dhudmessage(150150150, -1.00.7126.03.00.11.5 );
        
show_dhudmessage(id"%s, Resteo su Score.!"name);
        if(
get_pcvar_num(rs_sound))
        {
           
client_cmd(id"spk fvox/bell");
        }
 }


El Abuelo Loco is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-23-2020 , 18:35   Re: ResetScore
Reply With Quote #2

Quote:
they saturate the being
???
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
El Abuelo Loco
Senior Member
Join Date: Jun 2020
Old 11-23-2020 , 20:01   Re: ResetScore
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
???
I mean, they use the / rs many times in a single round. and my idea would be to decrease use it 1 time per round
El Abuelo Loco is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-23-2020 , 20:13   Re: ResetScore
Reply With Quote #4

Add a global bool new bool:g_bHasReset[33] and set it to true once the player resets, next round set it to false.
If the bool is true, block the command.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
El Abuelo Loco
Senior Member
Join Date: Jun 2020
Old 11-23-2020 , 20:24   Re: ResetScore
Reply With Quote #5

Quote:
Originally Posted by OciXCrom View Post
Add a global bool new bool:g_bHasReset[33] and set it to true once the player resets, next round set it to false.
If the bool is true, block the command.
so I did not put the poor thing and it did not work. heh

PHP Code:
new name[33];
new 
boolg_bHasReset [33];
new 
rs_hudmessage;
new 
rs_sound
El Abuelo Loco is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-23-2020 , 23:28   Re: ResetScore
Reply With Quote #6

You should post the plugin again with the code where you use the g_bHasReset variable as described by OciXCrom. If you have more questions, you need to ask them (but make sure to post the code that you tried with your question).
__________________
fysiks is offline
El Abuelo Loco
Senior Member
Join Date: Jun 2020
Old 11-24-2020 , 00:17   Re: ResetScore
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
You should post the plugin again with the code where you use the g_bHasReset variable as described by OciXCrom. If you have more questions, you need to ask them (but make sure to post the code that you tried with your question).
I added what they told me, I tried it but it doesn't work. you can keep pulling / rs as many times as you want

PHP Code:
#include <amxmodx>
#include <fun>
#include <cstrike>

new const PLUGIN_NAME[]  = "Reset_Score";
new const 
VERSION[] = "1.0";
new const 
AUTHOR[]  = "Silenttt Fixed by 9 rpamm!?";

new 
name[33];
new 
boolg_bHasReset [33];
new 
rs_hudmessage;
new 
rs_sound;
 
public 
plugin_init()
{
    
register_pluginPLUGIN_NAMEVERSIONAUTHOR );

    
register_clcmd("say /rs""reset_score");
    
register_clcmd("say /resetscore""reset_score");
    
    
rs_hudmessage register_cvar("rs_hudmessage""1");
    
rs_sound register_cvar("rs_sound""1");
}

public 
reset_score(id)
{
    
set_user_frags(id0);
    
cs_set_user_deaths(id0);

    if(
get_pcvar_num(rs_hudmessage))
    {
        
get_user_name(idname32);
        
set_dhudmessage(150150150, -1.00.7126.03.00.11.5 );
        
show_dhudmessage(id"%s, Resteo su Score.!"name);
        if(
get_pcvar_num(rs_sound))
        {
           
client_cmd(id"spk fvox/bell");
        }
 }


El Abuelo Loco is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-24-2020 , 01:24   Re: ResetScore
Reply With Quote #8

OciXCrom gave you 4 steps to complete to make it work like you requested. You only did the first step. Here is the list of steps laid out in a more explicit format so that it's easier to understand what you need to do.
  1. Add a global bool: new bool:g_bHasReset[33]
  2. set it to true once the player resets: g_bHasReset[id] = true
  3. next round set it to false: arrayset(g_bHasReset, false, sizeof g_bHasReset)
  4. If the bool is true, block the command.

You need to add code for each of these steps.
__________________

Last edited by fysiks; 11-24-2020 at 01:27.
fysiks is offline
Reply


Thread Tools
Display Modes

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:37.


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