[Pomoc]GM/ADMIN

Započeo caupton, Maj 02, 2011, 17:54:53 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim:Edit GF
Detaljan opis problema:Ovako imam problem kako da napravim komandu kada neko zove admina ili gamemastera da mu npr. admin ili gamemaster odgovori sa komandom npr /odg i da glasi ovako Admin/GameMaster Vam je Odgovorio:RECI
Dio skripte://
Neke slike/video za lakse dobivanje pomoci(neobavezno)://

PS.Hvala Unapred  :'(

Ako znas koristit dcmd onda je sve super

Znaci stavis neki naziv za tog igraca kojem ce komadna uputit poruku(tojest koji id)

new playa; (primjer)

I sad ono sve jel igrac povezan itd itd..nadam se da znas kad editas :)


#define BJELA         "{FFFFFF}"
#define CRNA          "{000000}"
#define ADMBOJA       "{00C0FF}"
#define GMBOJA        "{2adf1c}"
#define CNNBOJA       "{e6b00d}"
#define CRVENA        "{ff0000}"
#define AODG          "{0DD1CE}"
#define ZUTA          "{F3FF02}"
#define ZELENA        "{0cdf11}"
#define NARANCASTA    "{ffbb03}"
#define ZPLAVA        "{00b4ff}"


if(strcmp(cmd, "/aodg", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if (PlayerInfo[playerid][pAdmin] >= 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Koristite: "ZELENA"/aodg [Igracev ID/Dio imena] [Odgovor]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (IsPlayerConnected(giveplayerid))
{
    if(giveplayerid != INVALID_PLAYER_ID)
    {
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_WHITE, "Koristite: "ZELENA"/aodg [Igracev ID/Dio imena] [Odgovor]");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), ""ADMBOJA"Admin[ID:%d] "CRVENA"%s"ADMBOJA" vam je odgovorio: "BJELA"%s", playerid, sendername, (result));
SendClientMessage(giveplayerid, -1, string);
format(string, 256, ""ZUTA"AODG | "CRVENA"Admin "BJELA"%s je odgovorio igracu [ID:%d]%s:  "BJELA"%s", sendername, giveplayerid, giveplayer, (result));
ABroadCast(-1,string,1);
return 1;
}
}
else
{
format(string, sizeof(string), ""ZUTA"%d | "CRVENA"Nije Aktivan.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
}
}



if(strcmp(cmd, "/adm", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if (PlayerInfo[playerid][pAdmin] >= 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /adm [Igracev ID/Dio imena] [Odgovor]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (IsPlayerConnected(giveplayerid))
{
    if(giveplayerid != INVALID_PLAYER_ID)
    {
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, "USAGE: /adm [Igracev ID/Dio imena] [Odgovor]");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "Admin %s (ID: %d)kaze:{FFFFFF} %s", sendername, playerid, (result));
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, 256, "|A| %s | %s:{FFFFFF} %s", sendername, giveplayer, (result));
ABroadCast(COLOR_ODG,string,1);
return 1;
}
}
else
{
format(string, sizeof(string), "   %d nije aktivan igrac.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
              return 1;
}
}
    if(strcmp(cmd, "/godg", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if (PlayerInfo[playerid][pGameSages] >= 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /godg [Igracev ID/Dio imena] [Odgovor]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (IsPlayerConnected(giveplayerid))
{
    if(giveplayerid != INVALID_PLAYER_ID)
    {
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, "USAGE: /godg [Igracev ID/Dio imena] [Odgovor]");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "GameSage %s (ID: %d)kaze: %s", sendername, playerid, (result));
SendClientMessage(giveplayerid, COLOR_LIGHTGREEN, string);
format(string, 256, "GS | %s | %s:{FFFFFF}  %s ", sendername, giveplayer, (result));
ABroadCast(COLOR_ODG,string,1);
SendGSMessage(COLOR_ODG, "GS| %s | %s(ID: %d): %s", sendername, giveplayer, playerid, (result));
return 1;
}
}
else
{
format(string, sizeof(string), "   %d nije aktivan igrac.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
}