31.10.2014, 16:52
Proba asн:
pawn Код:
funcion MandarMensaje(Jugador, Texto[], Idioma)
{
new string[128];
new string2[128];
new Float:x, Float:y, Float:z;
GetPlayerPos(Jugador,x,y,z);
new Idioma2[10];
switch(Idioma)
{
case 1: Idioma2 = "alemбn";
case 2: Idioma2 = "бrabe";
case 3: Idioma2 = "chino";
case 4: Idioma2 = "espaсol";
case 5: Idioma2 = "francйs";
case 6: Idioma2 = "italiano";
case 7: Idioma2 = "japonйs";
case 8: Idioma2 = "portuguйs";
case 9: Idioma2 = "ruso";
}
if(strlen(Texto) > 75)
{
format(string2,256," ... %s ))",Texto[75]);
strdel(Texto,75,strlen(Texto));
format(string, sizeof(string), "%s dice: [%s] %s", NombreEx(Jugador), Idioma2, Texto);
ProxDetector(20.0, playerid, string,OOC1,OOC2,OOC3,OOC4,OOC5);
ProxDetector(20.0, playerid, string2,OOC1,OOC2,OOC3,OOC4,OOC5);
return 1;
}
else if(strlen(Texto) <= 75)
{
format(string, sizeof(string), "%s dice: [%s] %s", NombreEx(Jugador), Idioma2, Texto);
ProxDetector(20.0, playerid, string,OOC1,OOC2,OOC3,OOC4,OOC5);
return 1;
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && i != playerid)
{
if(PlayerToPoint(20,i, x, y, z))
//if(JugadorEnArea(20, i, x, y, z))
{
if(PlayerInfo[i][pIdiomas][Idioma] == 1)
{
if(strlen(Texto) > 75)
{
/* format(string2,256," ... %s ))",Texto[75]);
strdel(Texto,75,strlen(Texto));
format(string, sizeof(string), "%s dice: [%s] %s", NombreEx(Jugador), Idioma2, Texto);*/
ProxDetector(20.0, i, string,OOC1,OOC2,OOC3,OOC4,OOC5);
ProxDetector(20.0, i, string2,OOC1,OOC2,OOC3,OOC4,OOC5);
return 1;
}
else if(strlen(Texto) <= 75)
{
// format(string, sizeof(string), "%s dice: [%s] %s", NombreEx(Jugador), Idioma2, Texto);
ProxDetector(20.0, i, string,OOC1,OOC2,OOC3,OOC4,OOC5);
return 1;
}
}
else
{
format(string, sizeof(string), "%s dice: [Lenguaje Desconocido]", NombreEx(Jugador));
ProxDetector(20.0, i, string,OOC1,OOC2,OOC3,OOC4,OOC5);
return 1;
}
}
}
}
return 1;
}