[Ajuda] Comando Kick sу aceita como Motivo numeros
#1

Ai se alguem conseguir me dizer oq ha de errado:
PHP код:
CMD:kick(playerid, params[])
{
    new 
id, motivo, string[256], kickado[MAX_PLAYER_NAME];
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xAD0000AA, "{00E5FF}Vocк nгo pode usar este comando.");
    if(
sscanf(params, "ud", id, motivo)) return SendClientMessage(playerid, 0xAD0000AA, "Use /kick [ID] [MOTIVO]");
    if (
motivo == 0) return SendClientMessage(playerid, 0xFF0000FF, "Voce tem que dizer o motivo!");
    if(!
IsPlayerConnected(id)) return SendClientMessage(playerid, 0xAD0000AA, "Este jogador nгo estб online.");
    
GetPlayerName(id, kickado, sizeof(kickado));
    
format(string, sizeof(string), "O admin %s kickou voce pelo motivo: (%s) ", kickado,motivo);
    
SendClientMessage(id, -1, string);
    
Kick(id);
    return 
1;
} 
Reply
#2

PHP код:
new motivo[ 128 ];
if(
sscanf(params, "us[128]", id, motivo)) 
Quote:

if (motivo == 0) return SendClientMessage(playerid, 0xFF0000FF, "Voce tem que dizer o motivo!");

Nгo hб necessidade disto, uma vez que vocк esta usando o sscanf...
Reply
#3

pawn Код:
CMD:kick(playerid, params[])
{
    new string[128], kickado[MAX_PLAYER_NAME];
    if(!IsPlayerAdmin(playerid))
        return SendClientMessage(playerid, 0xAD0000AA, "{00E5FF}Vocк nгo pode usar este comando.");
    if(sscanf(params, "us[128]", params[0], params[1]))
        return SendClientMessage(playerid, 0xAD0000AA, "Use /kick [ID] [MOTIVO]");
    if(!IsPlayerConnected(params[0]))
        return SendClientMessage(playerid, 0xAD0000AA, "Este jogador nгo estб online.");
    GetPlayerName(params[0], kickado, sizeof(kickado));
    format(string, sizeof(string), "O admin %s kickou voce pelo motivo: (%s) ", kickado, params[1]);
    SendClientMessage(params[0], -1, string);
    Kick(params[0]);
    return 1;
}
no sscanf o 'd' e para numeros

's' para string's
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)