nece /g /ga i /a chat

Započeo trinty-less, Oktobar 10, 2021, 18:07:23 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 4 gostiju pregledaju ovu temu.

Problem(error/warning): ovako u svom modu sam doda system test admina dam mu dozvolu za /g /ga i /a chat da moze da pise ja udjem
ulogujem se na rcon i postavim a6 i postavim test admina i skinem sebi a6 komanda koju sam nap /ta duty radi ali kad pisem na /a
/g i /ga chat ne ispisuje nista ni dal sam ovlascen ni da je test admin napisao nesto apsolutno nis

Deo skripte:YCMD:ga(playerid, params[],help)
{
    #pragma unused help
    if(UlogovanProvera[playerid] == 0) return SCM(playerid,-1,"(BC:RPG) | "CRVENA"Moras se ulogovati da bi koristio ovu komandu!");
    if(PlayerInfo[playerid][pTestAdmin] >= 1 || PlayerInfo[playerid][pGM] >= 1 || PlayerInfo[playerid][pAdmin] >= 1)
   {
      if(PlayerInfo[playerid][pZatvor] != 0) return SCM(playerid,-1,"(BC:RPG) | "RG"Ne mozete koristiti ovu komandu jer ste zatvoreni!");
      if(PlayerInfo[playerid][pMuteg] == 1) return SCM(playerid,-1,"(BC:RPG) | "RG"Ne mozete koristiti ovu komandu zato sto ste mutirani na /g chat!");
      new text[256], string[128], sendername[MAX_PLAYER_NAME];
      GetPlayerName(playerid, sendername, sizeof(sendername));
      if(sscanf(params, "s[1024]", text)) return SCM(playerid, -1, ""CRVENA"(BC:RPG) Pomoc | "SIVA" /ga [tekst]");
      new arank[124];
       if(PlayerInfo[playerid][pAdmin] == 1) { arank = "Admin Level 1"; }
      else if(PlayerInfo[playerid][pAdmin] == 2) { arank = "Admin Level 2"; }
      else if(PlayerInfo[playerid][pAdmin] == 3) { arank = "Admin Level 3"; }
      else if(PlayerInfo[playerid][pAdmin] == 4) { arank = "Admin Level 4"; }
      else if(PlayerInfo[playerid][pAdmin] == 5) { arank = "Admin Level 5 (Head-Admin)"; }
      else if(PlayerInfo[playerid][pTestAdmin] == 1) { arank = "TestAdmin"; }
      else if(PlayerInfo[playerid][pVlasnik] == 1) { arank = "Vlasnik"; }
      else if(PlayerInfo[playerid][pAdmin] == 6) { arank = "Admin Level 6 (Direktor)"; }
      else if(PlayerInfo[playerid][pGM] == 1) { arank = "GameMaster Level 1"; }
      else if(PlayerInfo[playerid][pGM] == 2) { arank = "GameMaster Level 2"; }
      else if(PlayerInfo[playerid][pGM] == 3) { arank = "GameMaster Level 3"; }
      format(string, sizeof(string), "{157DEC}GA | "BELA"%s {157DEC}%s"BELA": %s",arank,sendername,text);
      AdminGameMaster(-1,string);
   }
   return 1;
}
evo /ga chat sacu dati /a i /g chatove
YCMD:g(playerid, params[],help)
{
    #pragma unused help
    if(UlogovanProvera[playerid] == 0) return SCM(playerid,-1,"BC:RPG | "CRVENA"Moras se ulogovati da bi koristio ovu komandu!");
    if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pGM] >= 1 || PlayerInfo[playerid][pPromoter] >= 1 || PlayerInfo[playerid][pVip] >= 1 || PlayerInfo[playerid][pTestAdmin] >= 1)
   {
   if(PlayerInfo[playerid][pZatvor] != 0) return SCM(playerid,-1,"BC:RPG | "RG"Ne mozete koristiti ovu komandu jer ste zatvoreni!");
   if(Konektovano() > 50) return SCM(playerid,-1,"BC:RPG | "RG"Admin je ugasio g chat zbog previlikog spama ");
   //if(ServerInfo[isGchat] == 1) return SCM(playerid,-1,""RG"(BC:RPG){ffffff} G chat je trenutno iskljucen!");
   if(PlayerInfo[playerid][pMuteg] == 1) return SCM(playerid,-1,"BC:RPG | "RG"Ne mozete koristiti ovu komandu zato sto ste mutirani na /g chat!");
   if(TogGChat[playerid] != 0) return SCM(playerid, -1," Admin Iskljucio G Chat");
   if(gettime() < Gchat[playerid] && PlayerInfo[playerid][pVlasnik] != 1) return SCM(playerid, -1, ""CRVENA"INFO | "SIVA"Ovu komandu mozete koristiti svakih 30 sekundi!");
   new text[256], string[128], sendername[MAX_PLAYER_NAME];
   GetPlayerName(playerid, sendername, sizeof(sendername));
   if(sscanf(params, "s[1024]", text)) return SCM(playerid, -1, ""CRVENA"BC:RPG Pomoc | "SIVA" /g [tekst]");
   new arank[124];
   if(PlayerInfo[playerid][pAdmin] == 1) { arank = "Admin Level 1"; }
   else if(PlayerInfo[playerid][pAdmin] == 2) { arank = "Admin Level 2"; }
   else if(PlayerInfo[playerid][pAdmin] == 3) { arank = "Admin Level 3"; }
   else if(PlayerInfo[playerid][pAdmin] == 4) { arank = "Admin Level 4"; }
   else if(PlayerInfo[playerid][pAdmin] == 5) { arank = "Admin Level 5 (Head-Admin)"; }
   else if(PlayerInfo[playerid][pTestAdmin] == 1) { arank = "TestAdmin"; }
    else if(PlayerInfo[playerid][pVlasnik] == 1) { arank = "Vlasnik"; }
   else if(PlayerInfo[playerid][pAdmin] == 6) { arank = "Admin Level 6 (Direktor)"; }
   else if(PlayerInfo[playerid][pTestAdmin] == 1) { arank = "Test Admin"; }
   else if(PlayerInfo[playerid][pGM] == 1) { arank = "GameMaster Level 1"; }
   else if(PlayerInfo[playerid][pGM] == 2) { arank = "GameMaster Level 2"; }
   else if(PlayerInfo[playerid][pGM] == 3) { arank = "GameMaster Level 3"; }
   else if(PlayerInfo[playerid][pPromoter] == 1) { arank = "Promoter"; }
   else if(PlayerInfo[playerid][pVip] == 1) { arank = "Vip Level 1"; }
   else if(PlayerInfo[playerid][pVip] == 2) { arank = "Vip Level 2"; }
   else if(PlayerInfo[playerid][pVip] == 3) { arank = "Vip Level 3"; }
   else if(PlayerInfo[playerid][pVip] == 4) { arank = "Vip Level 4"; }
   else if(PlayerInfo[playerid][pVip] == 5) { arank = "Premium"; }
   if(PlayerInfo[playerid][pVip] == 6) { arank = ""ELITE"Elite"; }
   format(string, sizeof(string), ""ZELENA"G | "BELA"%s "ZELENA"%s"BELA": %s",arank,sendername,text);
   AdminGameMasterVip(-1,string);
   Gchat[playerid] = gettime() + 30;
   }
   return 1;
}
evo ga i /g chat sacu dati i /a chat
YCMD:a(playerid, params[],help)
{
    #pragma unused help
    if(UlogovanProvera[playerid] == 0) return SCM(playerid,-1,"BC:RPG | "CRVENA"Moras se ulogovati da bi koristio ovu komandu!");
   if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pTestAdmin] < 1) return SCM(playerid, -1, ""CRVENA"[BC:RPG] "SIVA"Samo Admini!");
   new text[256], string[512], sendername[MAX_PLAYER_NAME];
   GetPlayerName(playerid, sendername, sizeof(sendername));
   if(sscanf(params, "s[1024]", text)) return SCM(playerid, -1, ""CRVENA"BC:RPG Pomoc | "BELA"/a [tekst]");
   new arank[64];
     
    if(PlayerInfo[playerid][pAdmin] == 1) { arank = "Admin Level 1"; }
   else if(PlayerInfo[playerid][pAdmin] == 2) { arank = "Admin Level 2"; }
   else if(PlayerInfo[playerid][pAdmin] == 3) { arank = "Admin Level 3"; }
   else if(PlayerInfo[playerid][pAdmin] == 4) { arank = "Admin Level 4"; }
   else if(PlayerInfo[playerid][pAdmin] == 5) { arank = "Admin Level 5 (Head-Admin)"; }
    else if(PlayerInfo[playerid][pTestAdmin] == 1) { arank = "TestAdmin"; }
    else if(PlayerInfo[playerid][pVlasnik] == 1) { arank = "Vlasnik"; }
   else if(PlayerInfo[playerid][pAdmin] == 6) { arank = "Admin Level 6 (Direktor)"; }
   else { arank = "Admin"; }
   format(string, sizeof(string), ""CRVENA"A | "BELA"%s "CRVENA"%s"BELA": %s",arank,sendername,text);
   SendAdminMessage(-1,string);
   return 1;
}
evo i /a chat sad mi pls pomozite
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log):
Poslednja Izmena: Oktobar 13, 2021, 02:45:36 PRE PODNE od M Ө M Σ N Z I

Asti gospe, šta je ovo. Pa zalijepi kod u quote ili pawn tablicu.
You'll be always in my heart, the end and thanks for amazing times. #WeAreLords

Nadjes de su ti chatovi definisani i tamo dodas da i test admin ima permisiju da gleda chat?

Ne vidim zasto tako pravite komande uopste, mnogo zauzima prostora i realno ne izgleda lepo. Evo primer kako sam ja uradio dacu ti /a chat

[pawn]
CMD:a(playerid, params[])
{
   if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pTA] < 1 && PlayerInfo[playerid][pAdministrator] < 1) return SCM(playerid, NS_ORANGE, "* Nemate ovlascenje za upotrebu ove
        komande.");
   if(sscanf(params, "s[128]", params)) return SCM(playerid,NS_YELLOW,"[KORISCENJE] "BELA"/a [Text]");
   new buffer[128]; GetPlayerName(playerid, buffer, MAX_PLAYER_NAME + 1);
        format(buffer, sizeof buffer, "A | "BELA"%s "CRVENA"%s"BELA": %s",PlayerInfo[playerid][pImeRanka], buffer,params);
        SendAdminMessage(NS_CRVENA,buffer);
        return 1;
}[/pawn]
Eh sad PlayerInfo[playerid][pImeRanka] ti je znaci pozicija na serveru ako je tipa AL1 pisace mu Admin Level 1, Primer kako izgleda

[pawn]
UpdateImeRanka(playerid)
{
   if(PlayerInfo[playerid][pImaRank] == 1) return 1;
        if(PlayerInfo[playerid][pAdmin] == 1) {
      strmid(PlayerInfo[playerid][pImeRanka], "Admin Level 1", 0, 30);
   }
   return 1;
}[/pawn]
UpdateImeRaka dodajes kod /postaviadmina, primer ispod SavePlayer ili kako vec je kod tebe
[pawn]
UpdateNameRank(player);[/pawn]

I to vam je to ustedeo si dosta vremena i pritom ti lepo izgleda, i sad kad zelis nesto ides primer

%s %s, prvo ti je ime ranka u ovom slucaju Admin Level 1 a drugo %s ti je nick admina, prosto i jednostavno uzivaj ako imas kakvih problema, javi mi se pm

Citat: Goku ^ poslato Oktobar 10, 2021, 23:25:01 POSLE PODNE
Ne vidim zasto tako pravite komande uopste, mnogo zauzima prostora i realno ne izgleda lepo. Evo primer kako sam ja uradio dacu ti /a chat

[pawn]
CMD:a(playerid, params[])
{
   if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pTA] < 1 && PlayerInfo[playerid][pAdministrator] < 1) return SCM(playerid, NS_ORANGE, "* Nemate ovlascenje za upotrebu ove
        komande.");
   if(sscanf(params, "s[128]", params)) return SCM(playerid,NS_YELLOW,"[KORISCENJE] "BELA"/a [Text]");
   new buffer[128]; GetPlayerName(playerid, buffer, MAX_PLAYER_NAME + 1);
        format(buffer, sizeof buffer, "A | "BELA"%s "CRVENA"%s"BELA": %s",PlayerInfo[playerid][pImeRanka], buffer,params);
        SendAdminMessage(NS_CRVENA,buffer);
        return 1;
}[/pawn]
Eh sad PlayerInfo[playerid][pImeRanka] ti je znaci pozicija na serveru ako je tipa AL1 pisace mu Admin Level 1, Primer kako izgleda

[pawn]
UpdateImeRanka(playerid)
{
   if(PlayerInfo[playerid][pImaRank] == 1) return 1;
        if(PlayerInfo[playerid][pAdmin] == 1) {
      strmid(PlayerInfo[playerid][pImeRanka], "Admin Level 1", 0, 30);
   }
   return 1;
}[/pawn]
UpdateImeRaka dodajes kod /postaviadmina, primer ispod SavePlayer ili kako vec je kod tebe
[pawn]
UpdateNameRank(player);[/pawn]

I to vam je to ustedeo si dosta vremena i pritom ti lepo izgleda, i sad kad zelis nesto ides primer

%s %s, prvo ti je ime ranka u ovom slucaju Admin Level 1 a drugo %s ti je nick admina, prosto i jednostavno uzivaj ako imas kakvih problema, javi mi se pm
ili jednostavno switch

Moze i to, ali eto dao sam mu kako je kod mene jer mi je lakse da samo kopiram od sebe, malo promenim da ne bude identicno i to je to eto mu

Citat: Fergosonn poslato Oktobar 10, 2021, 19:52:27 POSLE PODNE
Nadjes de su ti chatovi definisani i tamo dodas da i test admin ima permisiju da gleda chat?
gde da je stavim pokazi pls

Citat: Stefan Scripting poslato Oktobar 11, 2021, 05:55:37 PRE PODNE
gde da je stavim pokazi pls
Kucaj forward GameMaster chat ili sta vec i samo tu dodas nist vise

[pawn]forward AdminChat(color, string[]);
public AdminChat(color, string[])
{
   foreach(new i : Player)
   {
       if(PlayerInfo[pAdmin] >= 1 || PlayerInfo[pTestAdmin] >= 1)
       {
         SendClientMessage(i, color, string);
       }
   }
   return 1;
}[/pawn]

Citat: Fergosonn poslato Oktobar 11, 2021, 12:08:31 POSLE PODNE
[pawn]forward AdminChat(color, string[]);
public AdminChat(color, string[])
{
   foreach(new i : Player)
   {
       if(PlayerInfo[pAdmin] >= 1 || PlayerInfo[pTestAdmin] >= 1)
       {
         SendClientMessage(i, color, string);
       }
   }
   return 1;
}[/pawn]
uradio sam tako ali rade /g i /ga a /a uopste ne radi