[pomoc]mute komanda

Započeo Arnel_Bp, Maj 12, 2014, 19:28:17 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: moja od 0
Detaljan opis problema: dolje
Dio skripte:
imam cmd ovako
CMD:mute(playerid, params[])
{
    if(PlayerInfo[playerid][pAdminLevel] < 2) return SendClientMessage(playerid,-1,"{FF0000}Zao nam je ali ne mozete koristititi ovu komandu, neispravna je. Kucaj /komande da vidis tvoje komande.");
    new
id,reason[48],string[128];
    if(sscanf(params, "us[48]", id,reason)) return SCM(playerid, COLOR_RED, "Usage: /mute [Player ID/Player Name] [Reason]");
    if(!IsPlayerConnected(id)) return SCM(playerid, -1, "Taj igrac nije online!");
    format(string,sizeof(string),"{FF0000}Admin mute: %s (%s)",GetName(id),reason);
    SCMToAll(COLOR_RED,string);
    PlayerInfo[id][pMute] = 1;
    return 1;
}


onpalyertext ovako


if(PlayerInfo[playerid][pMute] == 1) {
SCM(playerid, COLOR_RED, "Ti si mutiran, ne mozes pricati...!");
return 0;
}

i onda kad mute igraca, on i dalje moze da prica? Sta je problem, kako to da napravim? Ali mu u users tamo u scriptfiles stavlja mute na 1.
Neke slike/video za lakse dobivanje pomoci(neobavezno):

if(PlayerInfo[playerid][pMute] == 1) return SCM(playerid, COLOR_RED, "Ti si mutiran, ne mozes pricati...!");
probaj
69

Citat: [UG]C++ poslato Maj 12, 2014, 19:29:43 POSLE PODNE
if(PlayerInfo[playerid][pMute] == 1) return SCM(playerid, COLOR_RED, "Ti si mutiran, ne mozes pricati...!");
probaj

ne moze, ima errora

stavio sam ovako

if(PlayerInfo[playerid][pMute] == 1) return SCM(playerid, COLOR_RED, "Ti si mutiran, ne mozes pricati...!");
return 0;
}


Citat: [UG]C++ poslato Maj 12, 2014, 19:43:27 POSLE PODNE
daj cijeli onplayertext

public OnPlayerText(playerid, text[])
{
if(PlayerInfo[playerid][pMute] == 1) {
SCM(playerid, COLOR_RED, "Ti si mutiran, ne mozes pricati...!");
return 0;
}
if(TextsActive[playerid] == 0)
{
new string[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s[%d]: {FFFFFF}%s",name,playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
// Yellow
if(TextsActive[playerid] == 1)
{
new string[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s[%d]: {FFFF00}%s",name,playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
// Red
if(TextsActive[playerid] == 2)
{
new string[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s[%d]: {FF0000}%s",name,playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
// Blue
if(TextsActive[playerid] == 3)
{
new string[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s[%d]: {0000BF}%s",name,playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
// Green
if(TextsActive[playerid] == 4)
{
new string[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s[%d]: {00FF00}%s",name,playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
// Gray
if(TextsActive[playerid] == 5)
{
new string[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s[%d]: {696969}%s",name,playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
// Pink
if(TextsActive[playerid] == 6)
{
new string[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s[%d]: {FF00FF}%s",name,playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
// White
if(TextsActive[playerid] == 7)
{
new string[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s[%d]: {FFFFFF}%s",name,playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
if(TextsActive[playerid] == 8)
{
new string[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s[%d]: {FF8000}%s",name,playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
if(TextsActive[playerid] == 9)
{
new string[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s[%d]: {00FFFF}%s",name,playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
if(TextsActive[playerid] == 10)
{
new string[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s[%d]: {000000}%s",name,playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
if(TextsActive[playerid] == 11)
{
new string[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s[%d]: {400040}%s",name,playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
return 0;
}

public OnPlayerText(playerid, text[])
{
if(PlayerInfo[playerid][pMute] == 1) return SCM(playerid, COLOR_RED, "Ti si mutiran, ne mozes pricati...!");
if(TextsActive[playerid] == 0)
{
new string[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s[%d]: {FFFFFF}%s",name,playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
// Yellow
if(TextsActive[playerid] == 1)
{
new string[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s[%d]: {FFFF00}%s",name,playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
// Red
if(TextsActive[playerid] == 2)
{
new string[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s[%d]: {FF0000}%s",name,playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
// Blue
if(TextsActive[playerid] == 3)
{
new string[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s[%d]: {0000BF}%s",name,playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
// Green
if(TextsActive[playerid] == 4)
{
new string[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s[%d]: {00FF00}%s",name,playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
// Gray
if(TextsActive[playerid] == 5)
{
new string[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s[%d]: {696969}%s",name,playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
// Pink
if(TextsActive[playerid] == 6)
{
new string[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s[%d]: {FF00FF}%s",name,playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
// White
if(TextsActive[playerid] == 7)
{
new string[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s[%d]: {FFFFFF}%s",name,playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
if(TextsActive[playerid] == 8)
{
new string[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s[%d]: {FF8000}%s",name,playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
if(TextsActive[playerid] == 9)
{
new string[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s[%d]: {00FFFF}%s",name,playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
if(TextsActive[playerid] == 10)
{
new string[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s[%d]: {000000}%s",name,playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
if(TextsActive[playerid] == 11)
{
new string[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s[%d]: {400040}%s",name,playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
return 0;
}
69

ako sam mute izbaci mi ovaj tekst, ali i dalje mogu da pricam :D :D Sta da mu radimo hehe

Da li ti uopste lepo cuvas varijable ? sta ako se varijable ne cuvaju i ne ocitavaju ? mozda je to problem, a mozda je i do koda if(PlayerInfo[playerid][pMute] == 1)
    {
        return 0;
    }
?

Citat: Blaeks poslato Maj 13, 2014, 13:09:59 POSLE PODNE
Da li ti uopste lepo cuvas varijable ? sta ako se varijable ne cuvaju i ne ocitavaju ? mozda je to problem, a mozda je i do koda if(PlayerInfo[playerid][pMute] == 1)
    {
        return 0;
    }
?
Zamo sprema na 1 aliii nece da ga mute :S

Onda nije problem to, posto mute ne postoji kao samp sistem, to je izmisljeno na principu dodavanja varijabla igracu i proveravanja istih

Citat: Blaeks poslato Maj 13, 2014, 21:32:30 POSLE PODNE
Onda nije problem to, posto mute ne postoji kao samp sistem, to je izmisljeno na principu dodavanja varijabla igracu i proveravanja istih
Pa sta da mu radim ?

ne mogu ovako na slepo da ti pomognem, ali probaj ovo http://forum.sa-mp.com/showthread.php?t=290311, stvarno je tesko na slepo nekome pomoci, moj ti je predlog da uradis nesto iznova

Citat: Blaeks poslato Maj 13, 2014, 21:41:23 POSLE PODNE
ne mogu ovako na slepo da ti pomognem, ali probaj ovo http://forum.sa-mp.com/showthread.php?t=290311, stvarno je tesko na slepo nekome pomoci, moj ti je predlog da uradis nesto iznova

Aj probam pa ti javim..

nmg bas da se snadjem u ovu FS, posto bih zelio da ga prebacim u gamemode, da ga spomijm sa mojim admin systemom, evo sve kako je stavljeno..

enum pInfo
{
    pAdminLevel,
    pCash,
    pScore,
    pMute,
    pFrozen,
    pSpecating,
}
new PlayerInfo[MAX_PLAYERS][pInfo];



onda dolje na

public OnPlayerDisconnect(playerid, reason)

mi ovako stoji

dini_IntSet(file, "Mute", PlayerInfo[playerid][pMute]);

i onda dolje na dialog reg/login

dini_IntSet(file, "Mute",PlayerInfo[playerid][pMute] = 0);

i evo mi je dolje komanda za mute

CMD:mute(playerid, params[])
{
    if(PlayerInfo[playerid][pAdminLevel] < 2) return SendClientMessage(playerid,-1,"{FF0000}Zao nam je ali ne mozete koristititi ovu komandu, neispravna je. Kucaj /komande da vidis tvoje komande.");
    new
id,reason[48],string[128];
    if(sscanf(params, "us[48]", id,reason)) return SCM(playerid, COLOR_RED, "Usage: /mute [Player ID/Player Name] [Reason]");
    if(!IsPlayerConnected(id)) return SCM(playerid, -1, "Taj igrac nije online!");
    format(string,sizeof(string),"{FF0000}Admin mute: %s (%s)",GetName(id),reason);
    SCMToAll(COLOR_RED,string);
    PlayerInfo[id][pMute] = 1;
    return 1;
}


jeli bi sad mogao nesto da mi pomognes oko ovoga?