[code]Comme ça
[code]
if(strcmp(cmd, "/b", true) == 0)//CHAT HRP BY ERIK
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Vous devez d'abord ouvrir une session !");
return 1;
}
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, "CMD: /b [Chat HRP]");
return 1;
}
if(FindIP(result)) /// Anti-Pub
{
SendClientMessage(playerid, COLOR_RED, "[Anti-PUB] Vous avez été EXILER pour avoir fait une pub ");
new advertiser[MAX_PLAYER_NAME];
GetPlayerName(playerid, advertiser, sizeof(advertiser));
format(string, sizeof(string), "[Anti-PUB] %s a été EXILER de la ville. Raison: Pub",advertiser);
SendClientMessageToAll(COLOR_LIGHTRED,string);
BanLog(string);
Ban(playerid);
return 1;
}
format(string, sizeof(string), "%s dit:(( %s ))",sendername, result);
SetPlayerChatBubble(playerid, string, COLOR_WHITE, 100.0, 10000);
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
printf("%s", string);
}
return 0;
{
if (AdminDuty[playerid] == 1 )
{
new result[64];
format(string, sizeof(string), "Administrateur dit:(( %s ))", result);
SetPlayerChatBubble(playerid, string, COLOR_WHITE, 100.0, 10000);
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
printf("%s", string);
}
}
return 1;
}
Ou a la fin
new result[64];
format(string, sizeof(string), "Administrateur dit:(( %s ))", result);
SetPlayerChatBubble(playerid, string, COLOR_WHITE, 100.0, 10000);
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
printf("%s", string);
}
}
return 0;
}
[/code][/code]