Jump to content

Question

Posted

Cand dau cuiva warn imi cade serverul ce pot face ? :|

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

{

    if(IsPlayerConnected(playerid))

    {

    tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

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

return 1;

}

PlayerInfo[giveplayerid][pWarns] += 1;

if(PlayerInfo[giveplayerid][pWarns] >= 5)

{

    new year, month,day;

getdate(year, month, day);

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

BanLog(string);

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

SendClientMessageToAll(COLOR_LIGHTRED, string);

PlayerInfo[giveplayerid][pWarns] = 0;

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

PlayerInfo[giveplayerid][pLocked] = 1;

new playersip[256];

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

        SendClientMessage(giveplayerid,COLOR_DBLUE,"|___________[bAN INFO]___________|");

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

                            SendClientMessage(giveplayerid, COLOR_WHITE, string);

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

                            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(4 warnuri).",(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,"|___________[bAN INFO]___________|");

                            SendClientMessage(giveplayerid,COLOR_LIGHTRED,"[bAN INFO]: Poti face o cerere de unban pe forumul nostru.Forumul este nu avem deocamdata.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;

}

new year, month,day;

getdate(year, month, day);

format(string, sizeof(string), "You warned %s, reason: %s", giveplayer, (result));

SendClientMessage(playerid, COLOR_LIGHTRED, string);

format(string, sizeof(string), "You were warned by %s, reason: %s", sendername, (result));

SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);

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

SendClientMessageToAll(0xE42217FF, string);

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

WarnLog(string);

Kick(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]

Care e problema :-?

4 answers to this question

Recommended Posts

Posted

Hmm incearca comanda asta :

if(strcmp(cmd, "/warn", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

    tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

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

return 1;

}

PlayerInfo[giveplayerid][pWarns] += 1;

if(PlayerInfo[giveplayerid][pWarns] >= 3)

{

    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 (had 3 Warnings), reason: %s", giveplayer, sendername, (result));

SendClientMessageToAll(COLOR_LIGHTRED, string);

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

PlayerInfo[giveplayerid][pLevel] = -999;

Ban(giveplayerid);

return 1;

}

format(string, sizeof(string), "You warned %s, reason: %s", giveplayer, (result));

SendClientMessage(playerid, COLOR_LIGHTRED, string);

format(string, sizeof(string), "You were warned by %s, reason: %s", sendername, (result));

SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);

return 1;

}

}//not connected

}

else

{

format(string, sizeof(string), "{FFFFFF}[{0085FF}RO{FFFF26}-{FF1400}RP{FFFFFF}] {FFFFFF} %d nu este online.", giveplayerid);

SendClientMessage(playerid, COLOR_GRAD1, string);

}

}

return 1;

}

Sau vezi sa fie pusa comanda la onplayercommandtext

Posted

modifica! PlayerInfo[giveplayerid][pWarns] += 1; cu PlayerInfo[giveplayerid][pWarns] -= 1; sau faci la comanda /setstat:)

[pawn]

case 11: // aici pui care urmeaza

{

PlayerInfo[giveplayerid][pWarns] = amount;

}[/pawn]

 

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.