Jump to content
  • 0

Ajutor ban


diablo16

Question

2 answers to this question

Recommended Posts

[pawn]if(strcmp(cmd, "/bant", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

    tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /bant [playerid/PartOfName] [reason]");

return 1;

}

giveplayerid = ReturnUser(tmp);

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

{

    if(IsPlayerConnected(giveplayerid))

    {

        if(giveplayerid != INVALID_PLAYER_ID)

        {

    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

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, "USAGE: /ban [playerid/PartOfName] [reason]");

return 1;

}

                        if(bantime[playerid] == 1) return SendClientMessage(playerid, COLOR_GRAD2, "** Are you trying to ban this server?");

new year, month,day;

getdate(year, month, day);

format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);

BanLog(string);

format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", giveplayer, sendername, (result));

SendClientMessageToAll(COLOR_LIGHTRED, string);

                        new playersip[256];

GetPlayerIp(giveplayerid,playersip, sizeof(playersip));

    SendClientMessage(giveplayerid,CRISTIAN,"|______________Ban Info______________|");

            format(string, sizeof(string), "  Your nick: %s !",giveplayer);

                        SendClientMessage(giveplayerid, COLOR_GRAD1, string);

                        format(string, sizeof(string), "  Your ip is: %s !",playersip);

                        SendClientMessage(giveplayerid, COLOR_GRAD2, string);

                        format(string, sizeof(string), "  You are banned by: %s !",sendername);

                        SendClientMessage(giveplayerid, COLOR_GRAD3, string);

                        format(string, sizeof(string), "  Reason: %s !",(result));

                        SendClientMessage(giveplayerid, COLOR_GRAD4, string);

                        format(string, sizeof(string), "  Data: %d/%d/%d !",day,month,year);

                        SendClientMessage(giveplayerid, COLOR_GRAD5, string);

                        SendClientMessage(giveplayerid,CRISTIAN,"|______________Ban Info______________|");

                        SendClientMessage(giveplayerid,COLOR_LIGHTRED,"[bAN INFO]: Poti face o cerere de unban pe forumul nostru.Forumul este www.zonek.ro/forum Succes !");

                        SendClientMessage(giveplayerid,COLOR_WHITE,"[HINT]: Te sfatuim sa faci o poza la aceste informatii,si sa o postezi cand faci cerere unban.Apasa F8 pentru a face poza !");

                        bantime[playerid] = 1;

            SetTimerEx("bant", 10000, 0, "%d", playerid);

                        PlayerInfo[giveplayerid][pLocked] = 1;

Ban(giveplayerid);

return 1;

}

}//not connected

}

else

{

format(string, sizeof(string), "  %d is not an active player.", giveplayerid);

SendClientMessage(playerid, COLOR_GRAD1, string);

}

}

return 1;

}[/pawn]

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.