[Pomoc]Chat

Započeo MicroSD_, Mart 23, 2011, 23:28:45 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: moja, radim nesto
Detaljan opis problema: Kako da napravim da admini vide /report a GSovi pomoc


Dio skripte: Evo moj fail:
if(strcmp(cmd, "/report", 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, "Koristi: /report [text]");
return 1;
}
format(string, sizeof(string), "(Report) od %s[%d]: %s", sendername, playerid, (result));
ABroadCast(COLOR_NEWS,string,1);
SendClientMessage(playerid, COLOR_YELLOW, "Hvala na upitu! Admini ce sto brze odgovoriti!");
    }
    return 1;
}
if(strcmp(cmd,"/pomoc",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, "Koristi: /pomoc [text]");
return 1;
}
    format(string, sizeof(string), "(Pomoc) od %s[%d]: %s", sendername, playerid, (result));
ABroadCast(COLOR_NEWS,string,1);
SendClientMessage(playerid, COLOR_YELLOW, "Vase pitanje je poslato Adminima & GameSagovima.");
    }
    return 1;
}


Neke slike/video za lakse dobivanje pomoci(neobavezno):
Poslednja Izmena: Mart 23, 2011, 23:54:22 POSLE PODNE od Cody

black_dota

A da stavis error?

EDIT: LOL nisam ni procitao do kraja xD, zapricali se na MSN :P

Vidi dodas
if(PlayerInfo[playerid][pGameMaster] >= 1)
kod pomoc
a
if(PlayerInfo[playerid][pAdmin] >= 1)
kod report

http://pastebin.com/kJYFRtQ0
Poslednja Izmena: Mart 24, 2011, 00:21:40 PRE PODNE od [InfernoGaming]dJ^DotA

a pricas gluposti ??

sada kad ocu napisat report i pomoc moram biti admin/GS -.-

black_dota

Lol cek spavalo mi se

Sad cu ti napraviti

Ako ti ni ovo neradi http://pastebin.com/HdCNzEge, moraces da napravis callback na primer GBroadCast i da u njega ubacis if(PlayerInfo[playerid][pGameSage] >= 1)

A u ABroadCast ostaviti samo if(PlayerInfo[playerid][pAdmin] a ovo pgamesage obrisati
Poslednja Izmena: Mart 24, 2011, 08:03:47 PRE PODNE od [InfernoGaming]dJ^DotA

Na kraj moda:


stock SendClientMessageToGameSages(text[],color,GSLevel)
{
for(new i=0; i<500;i=+1;)
{
if(PlayerInfo[i][pGameSage] < GSLevel) return 1;
SendClientMessage(i,boja,text);

}
return 1;
}

stock SendClientMessageToAdmins(text[],color,ADMLevel)
{
for(new i=0; i<500;i=+1;)
{
if(PlayerInfo[i][pAdmin] < ADMLevel) return 1;
SendClientMessage(i,color,text);

}
return 1;
}


U komande ovo:

        if(strcmp(cmd, "/report", 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, "Koristi: /report [text]");
return 1;
}
format(string, sizeof(string), "(Report) od %s[%d]: %s", sendername, playerid, (result));
SendClientMessageToAdmins(string,COLOR_RED,1);
SendClientMessage(playerid, COLOR_YELLOW, "Hvala na upitu! Admini ce sto brze odgovoriti!");
   }
   return 1;
}
if(strcmp(cmd,"/pomoc",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, "Koristi: /pomoc [text]");
return 1;
}
   format(string, sizeof(string), "(Pomoc) od %s[%d]: %s", sendername, playerid, (result));
SendClientMessageToGameSages(string,COLOR_LIGHTBLUE,1);
SendClientMessage(playerid, COLOR_YELLOW, "Vase pitanje je poslato Adminima & GameSagovima.");
   }
   return 1;
}
Poslednja Izmena: Mart 24, 2011, 10:37:35 PRE PODNE od BloodMaster