[POMOC]/radio

Započeo Liquit, Februar 10, 2011, 12:20:42 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

RESIO SAM PROBLEM !
Znaci radim komandu radio i sve ok napravljeno samo imam problem kada udjem i kada pisem na /r izlazi mi 2put isti tekst nemogu da nadjem problem ? ..  Bio bi vam zahvalan ako mi neko pomogne..hvala puno


if(strcmp(cmd, "/radio", true) == 0 || strcmp(cmd, "/r", 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, "Koriscenje: (/r)adio [radio chat]");
return 1;
}
   if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "(Radio) Sef Policije %s: %s, prijem. ", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "(Radio) Zamjenik Sefa %s: %s, prijem. ", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "(Radio) Major %s: %s, prijem. ", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "(Radio) Inspektor %s: %s, prijem. ", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "(Radio) Policajac %s: %s, prijem. ", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "(Radio) Sobracajac %s: %s, prijem. ", sendername, result); }
else
{
format(string, sizeof(string), "(Radio) Policajac %s: %s, prijem. ", sendername, result);
}
ProxDetector(20.0, playerid, string,COLOR_LIGHTRED,COLOR_LIGHTRED,COLOR_LIGHTRED,COLOR_LIGHTRED,COLOR_LIGHTRED);
SendRadioMessage(1, TEAM_RADIO_COLOR, string);
printf("%s", string);
return 1;
   }
else if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
{
   if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "(Radio) Direktor %s: %s, prijem. ", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "(Radio) Zamjenik Direktora %s: %s, prijem. ", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "(Radio) Specijalni Agent %s: %s, prijem. ", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "(Radio) Tajni Agent %s: %s, prijem. ", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "(Radio) Agent %s: %s, prijem. ", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "(Radio) Novi Agent %s: %s, prijem. ", sendername, result); }
else
{
format(string, sizeof(string), "** %s(radio): %s, over. **", sendername, result);
}
ProxDetector(20.0, playerid, string,COLOR_LIGHTRED,COLOR_LIGHTRED,COLOR_LIGHTRED,COLOR_LIGHTRED,COLOR_LIGHTRED);
SendRadioMessage(2, TEAM_RADIO_COLOR, string);
printf("%s", string);
return 1;
}
else if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
{
   if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "(Radio) General %s: %s, prijem. ", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "(Radio) Zamjenik Generala %s: %s, prijem. ", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "(Radio) Major %s: %s, prijem. ", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "(Radio) Kapetan %s: %s, prijem. ", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "(Radio) Vodnik %s: %s, prijem. ", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "(Radio) Vojnik %s: %s, prijem. ", sendername, result); }
else
{
format(string, sizeof(string), "** %s(radio): %s, over. **", sendername, result);
}
ProxDetector(20.0, playerid, string,COLOR_LIGHTRED,COLOR_LIGHTRED,COLOR_LIGHTRED,COLOR_LIGHTRED,COLOR_LIGHTRED);
SendRadioMessage(2, TEAM_RADIO_COLOR, string);
printf("%s", string);
return 1;
}
else if(gTeam[playerid] == 1||PlayerInfo[playerid][pMember]==4||PlayerInfo[playerid][pLeader]==4)
{
format(string, sizeof(string), "(Radio) Doktor %s: %s, prijem. ", sendername, result);
SendRadioMessage(4, TEAM_RADIO_COLOR, string);
printf("%s", string);
return 1;
}
else if(PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7)
{
   if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "(Radio) Gradonacelnik %s: %s, prijem. ", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "(Radio) Gradonacelnikov Zastitar %s: %s, prijem. ", sendername, result); }
else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "(Radio) Gradonacelnikov Vozac %s: %s, prijem. ", sendername, result); }
else
{
format(string, sizeof(string), "** Not-assigned %s: %s, over. **", sendername, result);
}
SendRadioMessage(7, TEAM_RADIO_COLOR, string);
printf("%s", string);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "   Niste clan Tima !");
return 1;
}
}
return 1;
}
Poslednja Izmena: Februar 10, 2011, 14:52:22 POSLE PODNE od ZnaciNemanja

Budite na svome, budite na Afrika Gaming
www.afrika-gaming.com

Nadji u modu ovo:
SendRadioMessage ctrl+f

i kopiraj sve sto obuhvata to i stavi vamo!

ja sam od to nasao ovo? ja sam pocetnik pa mi nije skroz sve jasno..

}
SendRadioMessage(7, TEAM_RADIO_COLOR, string);
printf("%s", string);
return 1;
}


i ovo..
{
format(string, sizeof(string), "(Radio) Doktor %s: %s, prijem. ", sendername, result);
SendRadioMessage(4, TEAM_RADIO_COLOR, string);
printf("%s", string);
return 1;


evo i ovo..
}
ProxDetector(20.0, playerid, string,COLOR_LIGHTRED,COLOR_LIGHTRED,COLOR_LIGHTRED,COLOR_LIGHTRED,COLOR_LIGHTRED);
SendRadioMessage(2, TEAM_RADIO_COLOR, string);
printf("%s", string);
return 1;
}

Budite na svome, budite na Afrika Gaming
www.afrika-gaming.com

Nisam mislio na to znaci kliknes ctrl + f i onda u svom gm trazis SendRadioMessage trebalo bi ovako da izgleda samo trazi kako sam tamo naveo...
public SendRadioMessage(playerid

izvinite ako sam dosadan znaci znam za ctrl + f otvorim i pisem to nemogu da nadjem sa player id nego samo ovo od takvih..


public SendRadioMessage(member, color, string[])
{
foreach (Player, i)
{
    if(PlayerInfo[i][pMember] == member || PlayerInfo[i][pLeader] == member)
    {
SendClientMessage(i, color, string);
}
}
}
Poslednja Izmena: Februar 10, 2011, 12:57:54 POSLE PODNE od ZnaciNemanja

Budite na svome, budite na Afrika Gaming
www.afrika-gaming.com