Jump to content
  • 0

Problema admin chat /a


Alexandru2013

Question

Nick:Alexandru2013

Problema:Cand scriu /a test nu se vede ce scriu

Erori / warnings:

Lini/script:

if(strcmp(cmd, "/admin", 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_SI, "USAGE: /a [text]");

return 1;

}

if (PlayerInfo[playerid][pAdmin] == 1)

{

format(string, sizeof(string), ""MAYOR"• "SI"Trial Admin %s: "MAYOR" %s", sendername, result);

AdminsMessage(-1, string);

}

else if (PlayerInfo[playerid][pAdmin] == 2)

{

format(string, sizeof(string), ""MAYOR"• "SI"Good Admin %s: "MAYOR" %s", sendername, result);

AdminsMessage(-1, string);

}

else if (PlayerInfo[playerid][pAdmin] == 3)

{

format(string, sizeof(string), ""MAYOR"• "SI"Best Admin %s: "MAYOR" %s", sendername, result);

AdminsMessage(-1, string);

}

else if (PlayerInfo[playerid][pAdmin] == 4)

{

format(string, sizeof(string), ""MAYOR"• "SI"Head Admin %s: "MAYOR" %s", sendername, result);

AdminsMessage(-1, string);

}

else if (PlayerInfo[playerid][pAdmin] == 1337)

{

format(string, sizeof(string), ""MAYOR"• "SI"Co-Owner %s: "MAYOR" %s", sendername, result);

AdminsMessage(-1, string);

}

else if (PlayerInfo[playerid][pAdmin] == 1338)

{

format(string, sizeof(string), ""MAYOR"• "SI"Owner %s: "MAYOR" %s", sendername, result);

AdminsMessage(-1, string);

}

else if (PlayerInfo[playerid][pAdmin] == 1339)

{

format(string, sizeof(string), ""MAYOR"• "SI"R00t Admin %s: "MAYOR" %s", sendername, result);

AdminsMessage(-1, string);

}

new y, m, d;

new h, mi, s;

getdate(y,m,d);

gettime(h,mi,s);

format(string, sizeof(string), "[Data comenzii]: (%d-%d-%d). [Ora comenzii]: [%d:%d:%d]", d, m, y, h, mi, s);

    AdminChatLog(string);

          format(string, sizeof(string), "[Atentie]: %s Admin Level %d: %s", sendername, PlayerInfo[playerid][pAdmin], result);

    AdminChatLog(string);

}

return 1;

}

Ai incercat sa rezolvi singur ?:Am incercat sa iau de la alt sv dar da eroare

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

Pai am schimbat cu asta:

[pawn]//----------------------------------[AdminChat]-----------------------------------------------

if(strcmp(cmd, "/admin", 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++;

}

for(new i=0; i<MAX_PLAYERS; i++)

if(FindIP(result)) ///

{

  new advertiser[MAX_PLAYER_NAME];

  GetPlayerName(playerid, advertiser, sizeof(advertiser));

  format(string, sizeof(string), "[Warning]: %s face reclama ",advertiser,i);

  ABroadCast(COLOR_LIGHTRED,string,1);

  return 0;

}

result[idx - offset] = EOS;

if(!strlen(result))

{

SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/a)dmin [admin chat]");

return 1;

}

new arank[128];

if(PlayerInfo[playerid][pAdmin] == 1) { arank = "Test Admin"; }

else if(PlayerInfo[playerid][pAdmin] == 2) { arank = "Advanced Admin"; }

else if(PlayerInfo[playerid][pAdmin] == 3) { arank = "Good Admin"; }

else if(PlayerInfo[playerid][pAdmin] == 4) { arank = "Proffesional Admin"; }

else if(PlayerInfo[playerid][pAdmin] == 5) { arank = "Co-Owner"; }

else if(PlayerInfo[playerid][pAdmin] == 6) { arank = "Owner"; }

else if(PlayerInfo[playerid][pAdmin] == 7) { arank = "Scripter"; }

else if(PlayerInfo[playerid][pAdmin] == 8) { arank = "Fondator"; }

else { arank = "Owner"; }

format(string, sizeof(string), "*** %s %s *** %s", arank, sendername, result);

if (PlayerInfo[playerid][pAdmin] >= 1)

{

SendAdminMessage(COLOR_YELLOW, string);

}

printf("Admin %s: %s", sendername, result);

}

return 1;

}[/pawn]

simi da eroare asta:

B:\Diwnload\gamemoduri\Server\gamemodes\GMarea.pwn(38249) : warning 217: loose indentation

B:\Diwnload\gamemoduri\Server\gamemodes\GMarea.pwn(38250) : error 017: undefined symbol "FindIP"

B:\Diwnload\gamemoduri\Server\gamemodes\GMarea.pwn(38255) : error 017: undefined symbol "ABroadCast"

B:\Diwnload\gamemoduri\Server\gamemodes\GMarea.pwn(38258) : warning 217: loose indentation

B:\Diwnload\gamemoduri\Server\gamemodes\GMarea.pwn(38280) : error 017: undefined symbol "SendAdminMessage"

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

3 Errors.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.