Raised This Month: $ Target: $400
 0% 

[ZP] Ponerle lang al plugin modo.


  
 
 
Thread Tools Display Modes
Author Message
-Fanaticspx1
Senior Member
Join Date: Aug 2010
Location: Venezuela
Old 04-03-2012 , 02:11   [ZP] Ponerle lang al plugin modo.
#1

-Hola a todos, bueno no soy muy eficiente en pawn pero bueh, el problema es que he pasado horas y horas para poder ponerle al hud_tag en lang ya que para que al elegir el idioma espaņol e ingles cambie... Me pueden ayudar trate de esta forma y no sirvio {"%L", LANG_PLAYER, "MODO"}, Aqui esta el code.

PHP Code:
/*================================================================================

    [[ZP] Addon: Display the Current Mode
    Copyright (C) 2009 by meTaLiCroSS, Viņa del Mar, Chile
    
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
    In addition, as a special exception, the author gives permission to
    link the code of this program with the Half-Life Game Engine ("HL
    Engine") and Modified Game Libraries ("MODs") developed by Valve,
    L.L.C ("Valve"). You must obey the GNU General Public License in all
    respects for all of the code used other than the HL Engine and MODs
    from Valve. If you modify this file, you may extend this exception
    to your version of the file, but you are not obligated to do so. If
    you do not wish to do so, delete this exception statement from your
    version.
    
    ** Credits:
        
    - Exolent[jNr]: Big plugin optimization

=================================================================================*/

#include <amxmodx>
#include <zombieplague>

/*================================================================================
 [Customizations]
=================================================================================*/

// Hudmessage tag
new const hud_tag[] = "Modo actual: " <<<<<<---- AQUI PONERLE EL LANG

// Name for each Hudmessage Mode
new const mode_names[][] =
{
    
"Esperando modo...!!",    // No mode Started
    
"Normal",        // Normal Infection, single round
    
"Nemesis",            // Nemesis Mode (zombie boss)
    
"Survivor",        // Survivor Mode (human boss)
    
"Swarm",            // Swarm round (no infections)
    
"Multi-Infection",        // Multiple Infection (like single round, but, more than 1 zombie)
    
"Plague",            // Plague round (nemesis & zombies vs. survivors & humans)
    
"..."        // An unofficial mode (edited/created/modified by user)
}

// RGB Colors for each Hudmessage Mode
// See here some RGB Colors: http://web.njit.edu/~kevin/rgb.txt.html
new const rgb_hud_colors[sizeof(mode_names)][3] =
{
//    R    G    B
    
{255,     255,     255},        // No mode Started
    
{0,     255,     0},         // Normal Infection, single round
    
{255,     0,     0},        // Nemesis Mode (zombie boss)
    
{0,     0,     255},        // Survivor Mode (human boss)
    
{255,     255,     0},        // Swarm round (no infections)
    
{0,     255,     0},        // Multiple Infection (like single round, but, more than 1 zombie)
    
{255,     0,     0},        // Plague round (nemesis & zombies vs. survivors & humans)
    
{0,     255,     255}        // An unofficial mode (edited/created/modified by user)
}

// X Hudmessage Position ( --- )
const Float:HUD_MODE_X 0.65

// Y Hudmessage Position ( ||| )
const Float:HUD_MODE_Y 0.2

// Time at which the Hudmessage is displayed. (when user is puted into the Server)
const Float:START_TIME 3.0

/*================================================================================
 Customization ends here! Yes, that's it. Editing anything beyond
 here is not officially supported. Proceed at your own risk...
=================================================================================*/

// Variables
new g_SyncHudg_Mode

// Cvar pointers
new cvar_enablecvar_central

public plugin_init() 
{
    
// Plugin Info
    
register_plugin("[ZP] Addon: Display the Current Mode""0.1.6""meTaLiCroSS")
    
    
// Round Start Event
    
register_event("HLTV""event_RoundStart""a""1=0""2=0")
    
    
// Enable Cvar
    
cvar_enable register_cvar("zp_display_mode""1")
    
    
// Server Cvar
    
register_cvar("zp_addon_dtcm""v0.1.6 by meTaLiCroSS"FCVAR_SERVER|FCVAR_SPONLY)
    
    
// Variables
    
g_SyncHud CreateHudSyncObj()
    
    
cvar_central register_cvar("zp_on""1")
        
    if(!
get_pcvar_num(cvar_central))
        
pause("a"
}

public 
client_putinserver(id)
{
    
// Setting Hud
    
set_task(START_TIME"mode_hud"id__"b")
}

public 
event_RoundStart()
{
    
// Update var (no mode started / in delay)
    
g_Mode 0
}

public 
mode_hud(id)
{
    
// If the Cvar isn't enabled
    
if(!get_pcvar_num(cvar_enable))
        return;
    
    
// Hud Options
    
set_hudmessage(rgb_hud_colors[g_Mode][0], rgb_hud_colors[g_Mode][1], rgb_hud_colors[g_Mode][2], HUD_MODE_XHUD_MODE_Y06.012.0)
    
    
// Now the hud appears
    
ShowSyncHudMsg(idg_SyncHud"%s%s", (g_Mode == "" hud_tag), mode_names[g_Mode])
}

public 
zp_round_started(modeid)
{
    
// Update var with Mode num
    
g_Mode mode
    
    
// An unofficial mode
    
if(!(<= mode < (sizeof(mode_names) - 1)))
        
g_Mode sizeof(mode_names) - 1

__________________
DE LOS ERRORES SE APRENDE. ATT: Starsailor
-Fanaticspx1 is offline
Send a message via MSN to -Fanaticspx1 Send a message via Skype™ to -Fanaticspx1
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 04-03-2012 , 02:34   Re: [ZP] Ponerle lang al plugin modo.
#2

no podes con una constante si no me equivoco
__________________

www.amxmodx-es.com

Steam: Luchokoldo
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
-Fanaticspx1
Senior Member
Join Date: Aug 2010
Location: Venezuela
Old 04-03-2012 , 02:59   Re: [ZP] Ponerle lang al plugin modo.
#3

trate de mil formas pero no di la correcta -.-?
__________________
DE LOS ERRORES SE APRENDE. ATT: Starsailor
-Fanaticspx1 is offline
Send a message via MSN to -Fanaticspx1 Send a message via Skype™ to -Fanaticspx1
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 04-03-2012 , 03:18   Re: [ZP] Ponerle lang al plugin modo.
#4

no la hagas constante.. solo crea una variable y en plugin cfg mandale un formatex con el lang y q lo guarde en la variable y listo xD
__________________

www.amxmodx-es.com

Steam: Luchokoldo
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
SkiGz
BANNED
Join Date: Aug 2010
Location: Venezuela
Old 04-04-2012 , 22:48   Re: [ZP] Ponerle lang al plugin modo.
#5

PHP Code:
public mode_hud(id)
{
    
// If the Cvar isn't enabled
    
if(!get_pcvar_num(cvar_enable))
        return;
    
    
// Hud Options
    
set_hudmessage(rgb_hud_colors[g_Mode][0], rgb_hud_colors[g_Mode][1], rgb_hud_colors[g_Mode][2], HUD_MODE_XHUD_MODE_Y06.012.0)
    
    
// Now the hud appears
    
ShowSyncHudMsg(idg_SyncHud"%L"LANG_PLAYER"CURRENT_MOD""%s%s", (g_Mode == "" :        hud_tag), mode_names[g_Mode])

SkiGz is offline
Send a message via MSN to SkiGz
xLeoNNN
Veteran Member
Join Date: Sep 2010
Location: de_dust2
Old 04-04-2012 , 22:57   Re: [ZP] Ponerle lang al plugin modo.
#6

register_diccionary o como sea + %L + LANG_PLAYER, "LANG_NAME"
__________________
xLeoNNN is offline
Send a message via MSN to xLeoNNN
Old 05-05-2012, 16:28
eXploit111
This message has been deleted by shinoda.
 



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 09:58.


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