Jump to content
  • 0

[Problema]Kick/Ban nu apare


Mase

Question

Nick: Mase

Problema:  Am incercat fel si fel de comenzi [/kick] si [/ban]. Daca dau kick/ban cuiva apare in chat dar persoanei care primeste kick/ban nu-i apare..

Erori / warnings: Nu-mi da errori. Nu apare celui care a primit kick/ban

Lini/script: mai jos

Ai incercat sa rezolvi singur ?: Da

Comenzile

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

{

    if(IsPlayerConnected(playerid))

    {

    tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

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

return 1;

}

giveplayerid = ReturnUser(tmp);

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

{

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

return 1;

}

new year, month,day;

getdate(year, month, day);

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

KickLog(string);

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

SendClientMessageToAll(COLOR_LIGHTRED, string);

Kick(giveplayerid);

return 1;

}

}

}

else

{

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

SendClientMessage(playerid, COLOR_GRAD1, string);

}

}

return 1;

}[/pawn]

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

{

    if(IsPlayerConnected(playerid))

    {

    tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "{00A6FF}>>{FFFFFF} Scrie: /ban [playerid/PartOfName] [reason]");

return 1;

}

giveplayerid = ReturnUser(tmp);

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

{

    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, "{00A6FF}>>{FFFFFF} Scrie: /ban [playerid/PartOfName] [reason]");

return 1;

}

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);

PlayerInfo[giveplayerid][pAdmin] = PlayerInfo[giveplayerid][pLevel];

PlayerInfo[giveplayerid][pLevel] = -999;

                        new plrIP[16];

GetPlayerIp(giveplayerid,plrIP, sizeof(plrIP));

    SendClientMessage(giveplayerid,COLOR_DBLUE,"|{FFFFFF}|-------------|{FF0000}[bAN INFO]{FFFFFF}|-------------|{FF0000}|");

            format(string, sizeof(string), "Numele tau este: %s.",giveplayer);

                        SendClientMessage(giveplayerid, COLOR_WHITE, string);

                        format(string, sizeof(string), "IP-ul tau este: %s.",plrIP);

                        SendClientMessage(giveplayerid, COLOR_WHITE, string);

                        format(string, sizeof(string), "Ai fost banat de: %s.",sendername);

                        SendClientMessage(giveplayerid, COLOR_WHITE, string);

                        format(string, sizeof(string), "Ai fost banat pentru urmatorul motiv: %s.",(result));

                        SendClientMessage(giveplayerid, COLOR_WHITE, string);

                        format(string, sizeof(string), "Ai fost banat pe data de: %d/%d/%d (Ziua-Luna-Anul)",day,month,year);

                        SendClientMessage(giveplayerid, COLOR_WHITE, string);

                        SendClientMessage(giveplayerid,COLOR_DBLUE,"|{FFFFFF}|-------------|{FF0000}[bAN INFO]{FFFFFF}|-------------|{FF0000}|");

                        SendClientMessage(giveplayerid,COLOR_LIGHTRED,"[bAN INFO]: Poti face o cerere de unban pe forumul nostru.Forumul este www.{FFFFFF}[{4FD359}----{FFFFFF}.ro.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 !");

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

4 answers to this question

Recommended Posts

Incearca sa faci un timer...

Uite aici un tutorial: http://wiki.sa-mp.com/wiki/Kick

Nu mai deschideti in pu*a mea servere de SA:MP !

Jucati-va pe cele care sunt !   Sunt suficiente !

Reguli de bun simt:

1. Nu faceti reclama unde nu trebuie !

2. Nu injurati ca la usa cortului !

3. Daca esti analfabeti, taci din gura !

4. Nu abuza de 'scuze', 'din greseala' !

 

My work ::: http://pastebin.com/VRNRcaAs

Link to comment
Share on other sites

la inceputul scriptului,

[pawn]forward Kick_Ban ( playerid, bool: kickban ); public Kick_Ban ( playerid, bool: kickban ) return ( !kickban ) ? Kick ( playerid ) : Ban ( playerid );

#define Kick(%1) SetTimerEx ( "Kick_Ban", 500, false, "ii", %1, false )

#define Ban(%1) SetTimerEx ( "Kick_Ban", 500, false, "ii", %1, true )[/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.