14.02.2013, 14:24
Try this.
PS: dont put a stock inside a callback
and you can make new str[size]; instead of putting in stock BanWithMessage(playerid, str[])
PS: dont put a stock inside a callback
and you can make new str[size]; instead of putting in stock BanWithMessage(playerid, str[])
pawn Код:
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 ћaidejo nera." );
if(PlayerInfo[id][pPadmin] == 1) return SendClientMessage(playerid, -1, "Ka cia 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 ћaideja %s. (Prieћastis: %s)", aName, pName, reason );
SendClientMessageToAll( -1, str );
SetTimerEx("BanPublic", 1000, 0, "d", playerid);
return 1;
}
forward BanPublic(playerid);
public BanPublic(playerid)
{
SendClientMessage(playerid, 0xFF4444FF, "Jus uћblokuotas! Uћblokavo neteisingai? Pildyk unban anketa fr.tt.lt");
BanEx( playerid, "BanPublic" );
return 1; //you can also use true = 1
}