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

[Ayuda] Problema Con el ResetScore


  
 
 
Thread Tools Display Modes
Author Message
lJosdel
Member
Join Date: Mar 2013
Old 08-03-2013 , 14:49   [Ayuda] Problema Con el ResetScore
#1

Bueno Mi Problema con el resetscore , es que Yo queria Que Cuando se reiniciaran el score , Saliera publico y dijiera algo Con el nombre de quien se lo reinicio
Y me da error szName.
Este es el code
PHP Code:
/*
   This is a simple plugin I made that will just restart a players score
   making their deaths and kills set to 0, this is to help players out a
   little bit because they no longer have to reconnect or retry if they
   want their score to start over, they can just type a simple command
   
      ---------------------------------
       --------- MADE BY SILENTTT -----
        ------ MADE BY SILENTTT ------
         --  MADE BY SILENTTT -------
        ------ MADE BY SILENTTT ------
       --------- MADE BY SILENTTT -----
      ---------------------------------
*/

#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")
    
register_clcmd("say rs""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 
szName[33]
        
get_user_name(idszNamecharsmax(szName))
        
ChatColor(id"!g[%s] !yA Reiniciado su Score Que Tara"szName)
    }
    else
    {
        
ChatColor(id"!g[%s] !yA Reiniciado su Score Que Tara"szName//< ese szname me da error como lo soluciono?
    
}
    return 
PLUGIN_HANDLED
}

public 
advertise()
{
    
set_hudmessage(25500, -1.00.2000.212.0)
    
show_hudmessage(0"By typing /rs 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)")
    }
}

/*--------------------------------------------------------------------------------------------------
-----------------------------------------------COLOR CHAT-----------------------------------------*/

stock ChatColor(const id, const input[], any:...)
{
    new 
count 1players[32]
    static 
msg[191]
    
vformat(msg190input3)
    
    
replace_all(msg190"!g""^4"// Green Color
    
replace_all(msg190"!y""^1"// Default Color
    
replace_all(msg190"!team""^3"// Team Color
    
replace_all(msg190"!team2""^0"// Team2 Color
    
    
if (idplayers[0] = id; else get_players(playerscount"ch")
    {
        for (new 
0counti++)
        {
            if (
is_user_connected(players[i]))
            {
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i])
                
write_byte(players[i]);
                
write_string(msg);
                
message_end();
            }
        }
    }

lJosdel is offline
Stereo
Veteran Member
Join Date: Dec 2010
Old 08-03-2013 , 14:59   Re: [Ayuda] Problema Con el ResetScore
#2

Crea la variable szName antes del if, si no, solo detecta la variable lo que pongas dentro del if
Stereo is offline
lJosdel
Member
Join Date: Mar 2013
Old 08-03-2013 , 15:01   Re: [Ayuda] Problema Con el ResetScore
#3

En Palabras que pueda entender un noob como yo:$
lJosdel is offline
Stereo
Veteran Member
Join Date: Dec 2010
Old 08-03-2013 , 15:03   Re: [Ayuda] Problema Con el ResetScore
#4

PHP Code:
if(get_pcvar_num(pcvar_Display) == 1

       new 
szName[33
->
PHP Code:
new szName[33]
if(
get_pcvar_num(pcvar_Display) == 1


Last edited by Stereo; 08-03-2013 at 15:04.
Stereo is offline
lJosdel
Member
Join Date: Mar 2013
Old 08-03-2013 , 15:04   Re: [Ayuda] Problema Con el ResetScore
#5

Gracias
lJosdel is offline
lJosdel
Member
Join Date: Mar 2013
Old 08-03-2013 , 15:06   Re: [Ayuda] Problema Con el ResetScore
#6

Pero Cuando Le Doy rs No sale mi nombre u-u dime esta ultima porfa
lJosdel is offline
MexPower
Veteran Member
Join Date: Nov 2012
Old 08-03-2013 , 15:29   Re: [Ayuda] Problema Con el ResetScore
#7

PHP Code:
if(get_pcvar_num(pcvar_Display) == 1
    { 
        new 
szName[33
        
get_user_name(idszNamecharsmax(szName)) 
        
ChatColor(id"!g[%s] !yA Reiniciado su Score Que Tara"szName
    } 
    else 
    { 
        
ChatColor(id"!g[%s] !yA Reiniciado su Score Que Tara"szName//< ese szname me da error como lo soluciono? 
    
}
//---------------->
new szName[33
get_user_name(idszNamecharsmax(szName)) 
if(
get_pcvar_num(pcvar_Display) == 1
        
ChatColor(id"!g[%s] !yA Reiniciado su Score Que Tara"szName
    else 
        
ChatColor(id"!g[%s] !yA Reiniciado su Score Que Tara"szName
__________________
Allied Modders En Espaņol

Last edited by MexPower; 08-03-2013 at 15:29.
MexPower is offline
Ayudante
Member
Join Date: Jul 2013
Location: Mi Casa!
Old 08-03-2013 , 15:33   Re: [Ayuda] Problema Con el ResetScore
#8

Nooooo, Mex y va a poner yo...

Last edited by Ayudante; 08-03-2013 at 15:35.
Ayudante is offline
lJosdel
Member
Join Date: Mar 2013
Old 08-03-2013 , 15:44   Re: [Ayuda] Problema Con el ResetScore
#9

Gracias si funciona
lJosdel is offline
 



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 19:11.


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