Ça marche pas >.<
J'ai refait un petit test, ça passe direct dans le else de la vérification de la taille
Aprés un autre test j'me suis rendu compte que le message ne depasse jamais 127 caractères, donc je l'ai réduit à 126 dans le script et ça m'affiche 2 fois le message maintenant
function ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
if(IsPlayerConnected(playerid))
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
//new chaine[255];
//radi = 2.0; //Trigger Radius
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(!BigEar[i])
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
//Chaine = string;//<- Ça c'est la chaîne qui contiendra le message à afficher
// new FinChaine[128];
new c;
// ICI, ON REMPLI LA CHAINE D'UNE FACON OU D'UNE AUTRE
/* Si la chaîne fait plus de 128 caractères */
if (strlen (string) > 128)
{
SendClientMessage(i, COLOR_YELLOW, ">128");
/* On part du 128° caractère et on remonte la chaîne jusqu'à ce qu'on trouve un espace */
c=128;
while (string[c]!=' ' && i>0) // NB : Il y a un espace entre les deux quotes
{
i--; // Caractère précédent
}
/* A ce niveau, i nous donne l'index de l'endroit où il faut couper la chaine */
/* On remplace l'espace par un 0 binaire qui va terminer la chaine à cette endroit */
string[c] = 0;
/* On affiche les deux parties de la chaine */
//SendPlayerMessageToAll (playerid, Chaine); //Première partie qui se termine sur le caractère i
//SendPlayerMessageToAll (playerid, Chaine); //Deuxième partie de la chaine qui commence au caractère i+1
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
{
SendClientMessage(i, col1, string);
SendClientMessage(i, col1, string[i+1]);
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
SendClientMessage(i, col2, string);
SendClientMessage(i, col2, string[i+1]);
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
SendClientMessage(i, col3, string);
SendClientMessage(i, col3, string[i+1]);
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
SendClientMessage(i, col4, string);
SendClientMessage(i, col4, string[i+1]);
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
SendClientMessage(i, col5, string);
SendClientMessage(i, col5, string[i+1]);
}
}
else
{
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
{
SendClientMessage(i, col1, string);
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
SendClientMessage(i, col2, string);
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
SendClientMessage(i, col3, string);
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
SendClientMessage(i, col4, string);
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
SendClientMessage(i, col5, string);
}
}
}
else
{
SendClientMessage(i, col1, string);
}
}
}
}//not connected
return 1;
}