mod:GF
opis prolema:Kada nekog /mute on i dalje moze da pise na chatove!tj njemu izbaci da nemoze pisat al i dalje mu pokaze text iznad glave ! neznam u cemu je problem ! Evo komanda
cod:
if(strcmp(cmd, "/mute", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_ORANGE, "Koristite: {FFFFFF}/mute [Korisnicki ID ili Ime Korisnika] [vrijeme]");
return 1;
}
new playa;
new time;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
time = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo[playa][pMuted] == 0)
{
PlayerInfo[playa][pMuted] = 1;
PlayerInfo[playa][pMuteTime] = time*60;
printf("AdmCmd: %s silenced %s",sendername, giveplayer);
format(string, sizeof(string), " %s utisan si od %s, na %d minuta",giveplayer ,sendername,time);
SendClientMessage(giveplayerid, COLOR_WHITE,string);
format(string, sizeof(string), " Mute| %s je utisan od %s, na %d minuta",giveplayer,sendername,time);
SendAdminMessage(COLOR_RED, string);
}
else
{
PlayerInfo[playa][pMuted] = 0;
PlayerInfo[playa][pMuteTime] = 0;
printf("AdmCmd: %s unsilenced %s",sendername, giveplayer);
format(string, sizeof(string), " %s utisan si od %s, na 0 minuta",giveplayer ,sendername);
SendClientMessage(giveplayerid,COLOR_WHITE,string);
format(string, sizeof(string), " Mute| %s je utisan od %s, na 0 minuta",giveplayer,sendername);
SendAdminMessage(COLOR_LIGHTRED, string);
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "{FFFFFF}Admini samo!");
}
}
return 1;
}
Jel si koristio ChatBouble?!
Moze pisati u chatovima zato sto nisi verovatno napravio proveru da li je igrac mutan ili nije u komandama za chatove evo to uradi ovako recimo:
if(PlayerInfo[playerid][pMuted] > 0) return SendClientMessage(playerid, COLOR_GRAD1, "*Vi ste mutani! Ne mozete govoriti!");
to recimo ubaci u komandu za svaki chat i nece biti problema ;)
Citat: dock poslato Mart 14, 2012, 23:44:15 POSLE PODNE
Moze pisati u chatovima zato sto nisi verovatno napravio proveru da li je igrac mutan ili nije u komandama za chatove evo to uradi ovako recimo:
if(PlayerInfo[playerid][pMuted] > 0) return SendClientMessage(playerid, COLOR_GRAD1, "*Vi ste mutani! Ne mozete govoriti!");
to recimo ubaci u komandu za svaki chat i nece biti problema ;)
Da igracu izbaci taj text da je mutiran i da nemoze pricat al opet dopusti mu da napise text !
Stavi proveru medju chatove, kada je igrac izmutiran da mu kaze da ne moze to da koristi, kapiras?
Citat: Aldin Begovic poslato Mart 14, 2012, 23:50:06 POSLE PODNE
Citat: dock poslato Mart 14, 2012, 23:44:15 POSLE PODNE
Moze pisati u chatovima zato sto nisi verovatno napravio proveru da li je igrac mutan ili nije u komandama za chatove evo to uradi ovako recimo:
if(PlayerInfo[playerid][pMuted] > 0) return SendClientMessage(playerid, COLOR_GRAD1, "*Vi ste mutani! Ne mozete govoriti!");
to recimo ubaci u komandu za svaki chat i nece biti problema ;)
Da igracu izbaci taj text da je mutiran i da nemoze pricat al opet dopusti mu da napise text !
to stavis odmah ispod IsPlayerConnected znaci mozda stavis na kraj komande pa on zavrsi sta treba i tek onda izadje komentar, znaci stavi odma ispod IsPlayerConnected :)
Da stavio sam tako kako ste rekli al i dalje nece ! Tj ne ibaci mu na chatu da je napisao samo iznad glOOve !
Ajo pa ti tek sad kazes :D, pa mora ostati text iznad glave :P
Prvo nadji
public OnPlayerText(playerid, text[])
{
dodaj
if(PlayerInfo[playerid][pMuted] > 0) return SendClientMessage(playerid, COLOR_GRAD1, "*Vi ste mutani! Ne mozete govoriti!");
da izgleda ovako:
public OnPlayerText(playerid, text[])
{
if(PlayerInfo[playerid][pMuted] > 0) return SendClientMessage(playerid, COLOR_GRAD1, "*Vi ste mutani! Ne mozete govoriti!");
kod komandi za chat imas ovo:
if(IsPlayerConnected(playerid))
{
tu dodas isto ovo
if(PlayerInfo[playerid][pMuted] > 0) return SendClientMessage(playerid, COLOR_GRAD1, "*Vi ste mutani! Ne mozete govoriti!");
i to ce izgledati:
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMuted] > 0) return SendClientMessage(playerid, COLOR_GRAD1, "*Vi ste mutani! Ne mozete govoriti!");
Nebi trebalo da bude problema..