[Pomoc] /a, /g

Započeo MicroSD_, Februar 28, 2011, 21:46:43 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: mojaaa
Detaljan opis problema: Ovako... radim svoj mod... i sad imam problem...

Zalim napraviti kada admin napise u /g(GM chat ) da pise: npr. |1338|A|Ime_Prezime: text... i kada GM napise da pise: |1|GM| Bla bla ...

Imam problem... Kada admin pise na /a chat, GM ovi to vide... kako mogu napraviti da to ne bude tako...
Dio skripte:
if(strcmp(cmd, "/g", true) == 0 || strcmp(cmd, "/g", 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: (/g)dmin [admin chat]");
return 1;
}

new arank[64];
if(PlayerInfo[playerid][pAdmin] == 1) { arank = "1"; }
else if(PlayerInfo[playerid][pAdmin] == 2) { arank = "2"; }
else if(PlayerInfo[playerid][pAdmin] == 3) { arank = "3"; }
else if(PlayerInfo[playerid][pAdmin] == 4) { arank = "4"; }
else if(PlayerInfo[playerid][pAdmin] == 5) { arank = "5"; }
else if(PlayerInfo[playerid][pAdmin] == 6) { arank = "6"; }
else { arank = "Moderator"; }

format(string, sizeof(string), "|%s|A|%s:{FFFFFF} %s", arank, sendername, result);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
SendAdminMessage(COLOR_LIGHTGREEN, string);
}
printf("Admin %s: %s", sendername, result);



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, "USAGE: (/g)[gm chat]");
return 1;
}
format(string, sizeof(string), "|%d| GameMaster %s:{FFFFFF} %s", PlayerInfo[playerid][pGameMaster], sendername, result);
if (PlayerInfo[playerid][pGameMaster] >= 1)
{
SendAdminMessage(COLOR_LIGHTGREEN, string);
}
printf("GameMaster %s: %s", sendername, result);
}
return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno): /

ako imas negde PlayerInfo[playerid][pGameMaster] u /a komandi samo izbrises

evo ti komanda /a...
if(strcmp(cmd, "/a", true) == 0 || strcmp(cmd, "/a", 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: /a [Admin Chat]");
return 1;
}
format(string, sizeof(string), "|%d|A|%s:{FFFFFF} %s", PlayerInfo[playerid][pAdmin], sendername, result);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
SendAdminMessage(COLOR_LIGHTBLUE, string);
}
printf("Admin %s: %s", sendername, result);
}
return 1;
}

gledaj, u /g komandi imas if(PlayerInfo[playerid][pAdmin]) umesto PlayerInfo[playerid][pGameMaster] tako da komanda /g nece raditi na gmovima nego na adminima