18.08.2013, 12:31
Hi !
I have created a /radio command and when we type /r, informations about this cmd appear (it work), and if we put as argument a text (/r <text>), the text will be sent to all players in the team of playerid, but this does'nt work, idk why
Merci d'avance
I have created a /radio command and when we type /r, informations about this cmd appear (it work), and if we put as argument a text (/r <text>), the text will be sent to all players in the team of playerid, but this does'nt work, idk why
pawn Код:
if(strcmp("/r", cmdtext, true, 2) == 0)
{
new text[124], playername[MAX_PLAYER_NAME], finaltext[128];
if(sscanf(cmdtext[2], "s[124]", text))
{
SendClientMessage(playerid, -1, "[USAGE] /r(adio) <texte>");
SendClientMessage(playerid, 0x0DB0FFFF, "La radio sert а communiquer avec les membres de votre йquipe.");
return 1;
}
else
{
GetPlayerName(playerid, playername, sizeof(playername));
RPName(playername);
format(finaltext, sizeof(finaltext), "[RADIO] %s dit: %s", playername, text);
for(new i=0; i>MAX_PLAYERS; i++)
{
if(gTeam[playerid] == 0 && gTeam[i] == 0)
{
if(IsPlayerConnected(i))
{
SendClientMessage(playerid, COLOR_RADIO, finaltext);
SendClientMessage(i, COLOR_RADIO, finaltext);
return 1;
}
}
if(gTeam[playerid] == 1 && gTeam[i] == 1)
{
if(IsPlayerConnected(i))
{
SendClientMessage(playerid, COLOR_RADIO, finaltext);
SendClientMessage(i, COLOR_RADIO, finaltext);
return 1;
}
}
}
}
return 1;
}