Senior Member
|
07-01-2016
, 15:01
Formatex multilanguage
|
#1
|
hello, how can I make that this line would have multilanguage?
Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <fun>
#include <hamsandwich>
#define TID_RESTORE_ORIGIN 457547
new g_max_players
new g_msg_saytext
new Float:g_t_origin[3]
new Float:g_b_origin[3]
new bool:g_valid_origin
public plugin_init(){
register_plugin("Replace Disconnected T", "1.3", "Sylwester")
RegisterHam(Ham_Use, "func_button", "button_pushed", 1)
RegisterHam(Ham_Spawn, "player", "Player_Spawn", 1)
register_dictionary( "Tdisconnect.txt" );
g_max_players = get_maxplayers()
g_msg_saytext = get_user_msgid("SayText")
}
public button_pushed(ent, idcaller, idactivator, use_type, Float:value){
if(!is_user_alive(idcaller) || !pev_valid(ent))
return
new Float:ftmp[3]
pev(ent, pev_mins, g_b_origin)
pev(ent, pev_maxs, ftmp)
for(new i=0; i<3; i++)
g_b_origin[i] = (g_b_origin[i]+ftmp[i])/2
pev(idcaller, pev_origin, g_t_origin)
if(pev(idcaller, pev_flags) & FL_DUCKING)
g_t_origin[2] += 19
g_valid_origin = true
}
public Player_Spawn(id){
if(!is_user_alive(id))
return
if(cs_get_user_team(id) != CS_TEAM_T)
return
g_valid_origin = false
}
public client_disconnect(id){
new players[32], pnum
for(new i=1; i<=g_max_players; i++){
if(!is_user_alive(i) || i==id || is_user_bot(i))
continue
if(cs_get_user_team(i) == CS_TEAM_T)
return
players[pnum++] = i
}
if(pnum<=0)
return
new new_terr = players[random(pnum)]
cs_set_user_team(new_terr, CS_TEAM_T)
new msg[128], otname[32], ntname[32]
get_user_name(id, otname, 31)
get_user_name(new_terr, ntname, 31)
formatex(msg, 127, "%L", "MSG", otname, ntname)
message_begin(MSG_ALL, g_msg_saytext, _, 0)
write_byte(new_terr)
write_string(msg)
message_end()
if(!g_valid_origin){
ExecuteHamB(Ham_CS_RoundRespawn, new_terr)
return
}
ExecuteHamB(Ham_CS_RoundRespawn, new_terr)
new param[2]
param[0] = new_terr
param[1] = 10 //max teleport attempts
restore_origin(param)
}
public restore_origin(param[]) {
if(param[1]<=0 || !is_user_alive(param[0]))
return
new tr, Float:ftmp[3], i, j
for(i=0; i<3; i++)
ftmp[i] = g_t_origin[i]
new Float:fraction
for(i=0; i<100; i++){
//find vacant location
engfunc(EngFunc_TraceHull, ftmp, ftmp, 0, HULL_HUMAN, 0, tr)
if(get_tr2(tr, TR_StartSolid) || get_tr2(tr, TR_AllSolid)){
for(j=0; j<3; j++)
ftmp[j] += random_float(-10.0, 10.0)
continue
}else{
//check if new location is on the correct side of the wall
engfunc(EngFunc_TraceLine, g_t_origin, ftmp, DONT_IGNORE_MONSTERS, 0, tr)
get_tr2(tr, TR_flFraction, fraction)
if(fraction != 1.0){
break
}
}
set_pev(param[0], pev_origin, ftmp) //move player to vacant location
for(j=0; j<3; j++){
g_t_origin[j] = ftmp[j] //store vacant location in case current player leaves before using any buttons
ftmp[j] = g_b_origin[j]-g_t_origin[j] //reuse ftmp in angle calculations
}
g_valid_origin = true
//calculate angles
new Float:xy_dist = floatsqroot(ftmp[0]*ftmp[0] + ftmp[1]*ftmp[1])
ftmp[1] = floatacos(ftmp[0]/xy_dist, 1)*(1-2*_:(ftmp[1]<0))
ftmp[0] =-floatatan(ftmp[2]/xy_dist, 1)
ftmp[2] = 0.0
//aim at button
set_pev(param[0], pev_angles, ftmp)
set_pev(param[0], pev_fixangle, 1)
return
}
param[1]--
set_task(0.1, "restore_origin", TID_RESTORE_ORIGIN, param, 2)
}
I searched the forum, tried to fix it but I still couldn't make it >.> it says ML Not found.
|
|