Count. /kick & /ban.
#1

Is there a way to get a count, for example: The total amout of players kicked from this server is [number]..?

To only be show, on the /kick command? And the same again for /ban?

Thankyou.
Reply
#2

pawn Код:
new KickAndBans = 0;
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    if (reason == 2) { KickAndBans += 1; }
    return 1;
}
pawn Код:
stock DisplayKickAndBans(playerid)
{
    new string[64];
    format(string, sizeof(string), "There has been %i kick and bans", KickAndBans);
    SendClientMessage(playerid, 0xFFFFFFFF, string);
    return 1;
}
Althought you can make separate variables, one for bans and other for kicks, this one counts both in one.
Reply
#3

Quote:
Originally Posted by admantis
Посмотреть сообщение
pawn Код:
new KickAndBans = 0;
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    if (reason == 2) { KickAndBans += 1; }
    return 1;
}
pawn Код:
stock DisplayKickAndBans(playerid)
{
    new string[64];
    format(string, sizeof(string), "There has been %i kick and bans", KickAndBans);
    SendClientMessage(playerid, 0xFFFFFFFF, string);
    return 1;
}



Althought you can make separate variables, one for bans and other for kicks, this one counts both in one.
Bro, how do i do this, how could I put this into a FS?
Reply
#4

Quote:
Originally Posted by getty154
Посмотреть сообщение
Bro, how do i do this, how could I put this into a FS?
pawn Код:
new KickAndBans = 0; //Put this at the top of your script under #include <a_samp>
pawn Код:
if (reason == 2) { KickAndBans += 1; }
return 1; // put these 2 lines under OnPlayerDisconnect
pawn Код:
stock DisplayKickAndBans(playerid)
{
    new string[64];
    format(string, sizeof(string), "There has been %i kick and bans", KickAndBans);
    SendClientMessage(playerid, 0xFFFFFFFF, string);
    return 1;
} // Put this function anywhere in your script, the very bottom is recommended.
Reply
#5

Quote:

if (reason == 2) { KickAndBans += 1; }

Why not simply:
pawn Код:
if(reason == 2) KickAndBans++;
Reply
#6

Quote:
Originally Posted by Lorrden
Посмотреть сообщение
Why not simply:
pawn Код:
if(reason == 2) KickAndBans++;
Wait, are you kidding?
It's the SAME thing. No difference, but my STYLE is different than you.
Stop kidding arround.
Reply
#7

I could put this in a FS, if you still need it.
Reply
#8

If you could?
Reply
#9

Here ya are:
SolidFiles: http://solidfiles.com/d/b2ac/
Notesbin: http://notesbin.com/1215213861
Reply
#10

Quote:
Originally Posted by admantis
Посмотреть сообщение
Wait, are you kidding?
It's the SAME thing. No difference, but my STYLE is different than you.
Stop kidding arround.
I know it's the same thing, but why make it more complicated than it really is?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)