16.08.2012, 17:13
yo se que es un poco tonta la pregunta pero como hago para que en el chat en ves de que aparesca asi 123456789 aparesca asi ********* ? como hago eso
public OnPlayerText(playerid, text[])
{
for(new i, j=strlen(text); i<j; i++)
if('0' <= text[i] <= '9')
text[i] = '*';
return 1;
}
public OnPlayerText(playerid, text[])
{
new nums, dots, ddots, len;
len = strlen(text);
for(new i; i<len; i++)
{
if('0' <= text[i] <= '9')
nums++;
else if(text[i] == '.')
dots++;
else if(text[i] == ':')
ddots++;
}
if(nums > 7 && dots > 2 && ddots > 0)
for(new i; i<len; i++)
if('0' <= text[i] <= '9')
text[i] = '*';
return 1;
}
if(strcmp(cmd, "/h", true) == 0 || strcmp(cmd, "/hablar", true) == 0 || strcmp(cmd, "/h", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' ')){idx++;}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Servidor: Para Hablar Usa ( /h Texto ) ");
return 1;
}
new nums, dots, ddots, len;
len = strlen(result);
for(new i; i<len; i++)
{
if('0' <= result[i] <= '9')
nums++;
else if(result[i] == '.')
dots++;
else if(result[i] == ':')
ddots++;
}
if(nums > 7 && dots > 2 && ddots > 0)
for(new i; i<len; i++)
if('0' < result[i] < '9')
result[i] = '*';
new Hora, Minuto;
gettime(Hora,Minuto);
SetPlayerTime(playerid,Hora,Minuto);
format(string,256,"{0000FF}%d:%d {FFFFFF}.:{00FF00}%s{FFFFFF}:. {FFFF00}Dice{FFFFFF}: {FFFFFF}%s",Hora,Minuto,sendername,result);
SendClientMessageToAll(-1,string);
}
return 1;
}
if('0' < text[i] < '9')
//debia ser:
if('0' <= text[i] <= '9')