Raised This Month: $ Target: $400
 0% 

ResetScore 3.0


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands       
Bishop*
Junior Member
Join Date: Mar 2010
Old 03-19-2010 , 14:23   ResetScore 3.0
Reply With Quote #1

This is my first plugin that I am posting up, its a small plugin but I think the idea isnt too bad and somewhat original (the fact that I dont think anyone else has done it yet) and can be useful.


Description
This small plugin allows a player to reset their score back to 0 kills and 0 deaths, this saves them the trouble of reconnecting to your server to reset their score. It makes it easier on them because its a simple command that they would type, and helps your server by not having another person reconnecting and possibly lagging your server.

Client Commands
say /rs - This will reset their kills and deaths back to 0
say /resetscore - This will reset their kills and deaths back to 0
say /restartscore - This will reset their kills and deaths back to 0

-Unlike other plugin This plugin supports and say_team commands:
say_team /rs
say_team /resetscore
say_team /restartscore

Installation
the file rscore.amxx copy into
Quote:
cstrike\addons\amxmodx\plugins
the file rscore.sma copy into
Quote:
cstrike\addons\amxmodx\scripting
and at the end you open
Quote:
cstrike\addons\amxmodx\configs\plugins.ini
and you write this at the end
Quote:
rscore.amxx

Name:  efefefe.bmp
Views: 1719
Size:  53.3 KB

Name:  wfwfwfw.bmp
Views: 1624
Size:  48.5 KB

Name:  wdwdwdw.bmp
Views: 1623
Size:  66.7 KB
Attached Files
File Type: sma Get Plugin or Get Source (rscore.sma - 4182 views - 3.0 KB)

Last edited by Bishop*; 03-20-2010 at 06:40.
Bishop* is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-19-2010 , 14:40   Re: ResetScore 3.0
Reply With Quote #2

PHP Code:
public reset_score(id)
{
    
cs_set_user_deaths(id0)
    
set_user_frags(id0)
    
cs_set_user_deaths(id0)
    
set_user_frags(id0
Awesome !!

Ok end of joke, don't post your first plugins, and don't post useless plugins, and don't post plugins with other language than english inside if the plugin is not multilang.



Other than that :

- You did this :
PHP Code:
    cs_set_user_deaths(id0)
    
set_user_frags(id0)
    
cs_set_user_deaths(id0)
    
set_user_frags(id0
Because doing only once you though that scores were not updated, but set first frags, then deaths, and scores will be updated because the cstrike native cs_set_user_deaths update the scoreboard.

- You should set the hudchannel to -1 in every set_hudmessage of the plugin.

- don't hook every say command, register once "say /rsinfo" in plugin_init

- Use english
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 03-19-2010 at 14:48.
ConnorMcLeod is offline
fezh
Veteran Member
Join Date: Dec 2008
Location: BANNED
Old 03-19-2010 , 14:46   Re: ResetScore 3.0
Reply With Quote #3

Quote:
[Reset Score]: Maded by Bishop* | Verzija 3.0 |
__________________
"There is no knowledge, that is not power"
fezh is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-19-2010 , 14:51   Re: ResetScore 3.0
Reply With Quote #4

You should learn to read the rules, to code, and to indent properly.
__________________
Arkshine is offline
Bishop*
Junior Member
Join Date: Mar 2010
Old 03-19-2010 , 15:17   Re: ResetScore 3.0
Reply With Quote #5

Ouhhhhhhhhhhh
What should i do ?
Bishop* is offline
Bishop*
Junior Member
Join Date: Mar 2010
Old 03-19-2010 , 15:47   Re: ResetScore 3.0
Reply With Quote #6

I have changed language at English
Check now
Bishop* is offline
ditmesteam
Senior Member
Join Date: Oct 2009
Old 03-20-2010 , 06:16   Re: ResetScore 3.0
Reply With Quote #7

There were two reset score plugins in the forum!
Can you make: if player reconnect, score is still the same with before?
ditmesteam is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 03-20-2010 , 07:06   Re: ResetScore 3.0
Reply With Quote #8

I think I stick with sv_restartround 1
__________________
I am out of order!
grimvh2 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-20-2010 , 07:47   Re: ResetScore 3.0
Reply With Quote #9

Quote:
Originally Posted by ditmesteam View Post
There were two reset score plugins in the forum!
Can you make: if player reconnect, score is still the same with before?
http://forums.alliedmods.net/showthread.php?p=555695
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-20-2010 , 12:02   Re: ResetScore 3.0
Reply With Quote #10

Stolen Code Found Here :

http://forums.alliedmods.net/showthread.php?p=652449


Your code :

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

#define adtime      600.0

new pcvar_Notification
new pcvar_Overview

public plugin_init()
{
    
register_plugin("ResetScore /rs metod""3.0""Bishop*")
    
    
register_clcmd("say","handle_say")
    
register_clcmd("say /rs""reset_score")
    
register_clcmd("say /resetscore""reset_score")
    
register_clcmd("say /restartscore""reset_score")
    
register_clcmd("say_team /rs""reset_score")
    
register_clcmd("say_team /resetscore""reset_score")
    
register_clcmd("say_team /restartscore""reset_score")

    
pcvar_Notification register_cvar("sv_notification""1")  //Below explained how it works, by default is: 1
    
pcvar_Overview register_cvar("sv_overview""0")  // Below explained how it works, by default is: 0
    
    
if(get_cvar_num("sv_notification") == 1)
    {
        
set_task(adtime"advertise"___"b")
    }
}

public 
reset_score(id)
{
    
cs_set_user_deaths(id0)
    
set_user_frags(id0)
    
cs_set_user_deaths(id0)
    
set_user_frags(id0)
    
    if(
get_pcvar_num(pcvar_Overview) == 1)
    {
        new 
name[33]
        
get_user_name(idname32)
        
client_print(0print_chat"[Reset Score]: %s restarted his score"name//If sv_prikaz 1 looks like this message and see it all
    
}
    else
    {
        
client_print(idprint_chat"[Reset Score]: You have successfully restart your score"//If sv_prikaz 0 such rich message and see the only one who restarted score
    
}
}

public 
advertise()
{
    
set_hudmessage(25500, -1.00.2000.212.0)
    
show_hudmessage(0"say / rs if you want to restore your score to zero"//Notification is published every 10 minutes in the middle of the screen you can terminate the command sv_obavestenje 0
}

public 
client_putinserver(id)
{
    if(
get_pcvar_num(pcvar_Notification) == 1)
    {
        
set_task(10.0"connectmessage"id__"a"1
    }
}

public 
connectmessage(id)
{
    if(
is_user_connected(id))
    {
    
client_print(idprint_chat"[Reset Score]: say / rs if you want to restore your score to zero")  //This comes out to chat when the client connects to the server
    
}
}

public 
handle_say(id
{
                 new 
said[192]
    
read_args(said,191)
    
remove_quotes(said)
    if( (
containi(said"/rsinfo") != -1) )
                 {
    
client_print(idprint_chat"[Reset Score]: Maded by Bishop* | Version 3.0 |")  //Info o pluginu izlazi samo kada klijent ukuca say /rsinfo, ne diraj pls :*
                 
}


His code :

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

#define adtime     600.0 //Default of 10 minuites

new pcvar_Advertise
new pcvar_Display

public plugin_init()
{
    
register_plugin("Reset Score""1.0""Silenttt")
    
    
//You may type /resetscore or /restartscore
    
register_clcmd("say /resetscore""reset_score")
    
register_clcmd("say /restartscore""reset_score")
    
    
//This command by default will be set at 0
    //Change it to 1 in server.cfg if you want
    //A message to be shown to advertise this.
    
pcvar_Advertise register_cvar("sv_rsadvertise""0")
    
//This command by default is also 0
    //Change it to 1 in server.cfg if you want
    //It to show who reset their scores when they do it
    
pcvar_Display register_cvar("sv_rsdisplay""0")
    
    if(
get_cvar_num("sv_rsadvertise") == 1)
    {
        
set_task(adtime"advertise"___"b")
    }
}

public 
reset_score(id)
{
    
//These both NEED to be done twice, otherwise your frags wont
    //until the next round
    
cs_set_user_deaths(id0)
    
set_user_frags(id0)
    
cs_set_user_deaths(id0)
    
set_user_frags(id0)
    
    if(
get_pcvar_num(pcvar_Display) == 1)
    {
        new 
name[33]
        
get_user_name(idname32)
        
client_print(0print_chat"%s has just reset his score"name)
    }
    else
    {
        
client_print(idprint_chat"You have just reset your score")
    }
}

public 
advertise()
{
    
set_hudmessage(25500, -1.00.2000.212.0)
    
show_hudmessage(0"By typing /resetscore you can restart your deaths and kills back to 0")
}

public 
client_putinserver(id)
{
    if(
get_pcvar_num(pcvar_Advertise) == 1)
    {
        
set_task(10.0"connectmessage"id__"a"1)
    }
}

public 
connectmessage(id)
{
    if(
is_user_connected(id))
    {
    
client_print(idprint_chat"By typing /resetscore at any time during the game, you can reset your deaths and kills back to 0 (rather than reconnecting)")
    }

__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 02:13.


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