Ban With Message ?
#1

How to remake this code to ban?

Код:
forward KickPublic(playerid);
public KickPublic(playerid) { Kick(playerid); }

KickWithMessage(playerid, message[])
{
    SendClientMessage(playerid, 0xFF4444FF, message);
    SetTimerEx("KickPublic", 1000, 0, "d", playerid);
}
Reply
#2

pawn Код:
forward KickPublic(playerid);
public KickPublic(playerid) { Ban(playerid); }

KickWithMessage(playerid, message[])
{
    SendClientMessage(playerid, 0xFF4444FF, message);
    SetTimerEx("KickPublic", 1000, 0, "d", playerid);
}
Reply
#3

@windrush, you are wrong, you cannot use the call back twice, and make it affect differently.

pawn Код:
forward BanPublic(playerid);
public BanPublic(playerid) { Ban(playerid); }

BanWithMessage(playerid, message[])
{
    SendClientMessage(playerid, 0xFF4444FF, message);
    SetTimerEx("KickPublic", 1000, 0, "d", playerid);
    return 1;
}
Reply
#4

he dos'nt say "Make". He say "remake"

btw it have errors in your codes
Reply
#5

Thanks, but how to make to show reason and admin name which banned or kicked you? My ban and kick cmd:

Код:
CMD:ban( playerid, params[ ] )
{
    if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage( playerid, -1, "Tu ne administratorius!" );
    new
        id,
        reason[ 64 ]
    ;
    if(sscanf( params, "us[64]", id, reason ) ) return SendClientMessage( playerid, -1, "Naudojimas: /ban [Nickas] [Prieћastis]" );
    if( !IsPlayerConnected( id ) || id == INVALID_PLAYER_ID ) return SendClientMessage( playerid, -1, "Tokio ћaidėjo nėra." );
    if(PlayerInfo[id][pPadmin] == 1) return SendClientMessage(playerid, -1, "Ką čia darai?");
    new
        str[ 128 ],
        pName[ MAX_PLAYER_NAME ],
        aName[ MAX_PLAYER_NAME ]
    ;
    GetPlayerName( playerid, aName, MAX_PLAYER_NAME );
    GetPlayerName( id, pName, MAX_PLAYER_NAME );
    format( str, sizeof( str ), "%s Uћblokavo ћaidėją %s. (Prieћastis: %s)", aName, pName, reason ); //show like this
    SendClientMessageToAll( -1, str );
    BanEx( id,str);
    return 1;
}
Код:
CMD:kick( playerid, params[ ] )
{
    new
        id,
        reason[ 64 ]
    ;
    if( PlayerInfo[ playerid ][ pAdmin ] < 1 ) return SendClientMessage( playerid, 0xFF0000AA, "Tu ne administratorius!" );
    if(sscanf( params, "us[64]", id, reason ) ) return SendClientMessage( playerid, 0xDEEE20FF, "Naudojimas: /kick [Nick] [Prieћastis]" );
    if( !IsPlayerConnected( id ) || id == INVALID_PLAYER_ID ) return SendClientMessage( playerid, 0xDEEE20FF, "Tokio ћaidėjo nėra" );
    new
        str[ 128 ],
        pName[ MAX_PLAYER_NAME ],
        aName[ MAX_PLAYER_NAME ]
    ;
    GetPlayerName( playerid, aName, MAX_PLAYER_NAME );
    GetPlayerName( id, pName, MAX_PLAYER_NAME );
    format( str, sizeof( str ), "Administratorius %s iљmetė ћaidėją %s. Prieћastis: %s ", aName, pName, reason ); // show like this
    SendClientMessageToAll( 0xDEEE20FF, str );
    Kick( id );
    return 1;
}
Reply
#6

@ Topic poster:
pawn Код:
forward ban(playerid);
public ban(playerid)
{
    Ban(playerid);
    return 1;
}

KickWithMessage(playerid, message[])
{
    SendClientMessage(playerid, 0xFF4444FF, message);
    SetTimerEx("KickPublic", 1000, 0, "d", playerid);
}
Change it to:

[if] You want to change it to a banex

pawn Код:
forward KickPublic(playerid);
public KickPublic(playerid)
{
    Kick(playerid);

KickWithMessage(playerid, message[])
{
    SendClientMessage(playerid, 0xFF4444FF, message);
    SetTimerEx("ban", 10, 0, "d", playerid);
}
if you are making it for kick:

Change Ban(playerid); to Kick(playerid);
Reply
#7

Quote:
Originally Posted by ZayanImran
Посмотреть сообщение
@ Topic poster:
pawn Код:
forward ban(playerid);
public ban(playerid)
{
    Ban(playerid);
    return 1;
}

KickWithMessage(playerid, message[])
{
    SendClientMessage(playerid, 0xFF4444FF, message);
    SetTimerEx("KickPublic", 1000, 0, "d", playerid);
}
Change it to:

[if] You want to change it to a banex

pawn Код:
forward KickPublic(playerid);
public KickPublic(playerid)
{
    Kick(playerid);

KickWithMessage(playerid, message[])
{
    SendClientMessage(playerid, 0xFF4444FF, message);
    SetTimerEx("ban", 10, 0, "d", playerid);
}
if you are making it for kick:

Change Ban(playerid); to Kick(playerid);
Read post above, I don't need this anymore....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)