[Pedido] /FakeCmd e /FakeKill
#1

Alguйm poderia me ajudar para criar 2 comandos, /fakecmd e /fakekill

O /fakecmd й para fazer algum player digitar tal comando.

O /fakekill й para aparecer no chatkill que tal player matou tal player com tal arma.

Tipo assim...

/fakekill [id do player que mata] [id do player morto] [ e a arma]

Alguйm poderia fazer para mim? Ou me falar como cria e tal? Obrigado.


Meus comandos sгo assim...
Ex:
CMD:fakekill...
Reply
#2

Uma base:
pawn Код:
COMMAND:fakekill(playerid, params[])
{
    new KillerID, VictimID, reason;
    if (sscanf(params, "uu", KillerID, VictimID)) SendClientMessage(playerid, 0xFF0000AA, "Uso: /fakekill [id do player que mata] [id do player morto] []");
    else
    {
    SetPlayerHealth(VictimID, 0.0); //Mata o player que e morto
    SendDeathMessage(KillerID, VictimID, reason); //Coloca que o player morreu no chat-kill
    }
}
OBS: Nгo testado
OBS IMPORTANTIIIIIIIIIISSIMA: Necessinta plugin sscanf, by ******
Reply
#3

nem funciona isso D:
Reply
#4

pawn Код:
CMD: fakekill (playerid, params[] ) {

    new
        PlayerID,
        IDDeath,
        Weapon
    ;

    if ( sscanf (params, "uui", PlayerID, IDDeath, Weapon ) )
        return SendClientMessage(playerid, -1, "/Use: [id do player que mata] [id do player morto] [ e a arma] ");
       
       
    SendDeathMessage(PlayerID, IDDeath, Weapon);

    return true;

}

CMD: fakecmd ( playerid, params[] ) {

    new
        PlayerID,
        CMD[10]
    ;

    if ( sscanf (params, "us[10]", PlayerID, CMD ) )
        return SendClientMessage(playerid, -1, "Use: /fakecmd [Player ID] [CMD] ");
       
    CommandText(PlayerID, CMD);


    return true;
}
Reply
#5

Quote:
Originally Posted by iCasTiel
Посмотреть сообщение
pawn Код:
CMD: fakekill (playerid, params[] ) {

    new
        PlayerID,
        IDDeath,
        Weapon
    ;

    if ( sscanf (params, "uui", PlayerID, IDDeath, Weapon ) )
        return SendClientMessage(playerid, -1, "/Use: [id do player que mata] [id do player morto] [ e a arma] ");
       
       
    SendDeathMessage(PlayerID, IDDeath, Weapon);

    return true;

}

CMD: fakecmd ( playerid, params[] ) {

    new
        PlayerID,
        CMD[10]
    ;

    if ( sscanf (params, "us[10]", PlayerID, CMD ) )
        return SendClientMessage(playerid, -1, "Use: /fakecmd [Player ID] [CMD] ");
       
    CommandText(PlayerID, CMD);


    return true;
}
error 017: undefined symbol "CommandText"

O /fakekill deu certinho, mais o /fakecmd ta dando erro D:
Reply
#6

pawn Код:
CMD: fakecmd ( playerid, params[] ) {

    new
        PlayerID,
        CMD[10]
    ;

    if ( sscanf (params, "us[10]", PlayerID, CMD ) )
        return SendClientMessage(playerid, -1, "Use: /fakecmd [Player ID] [CMD] ");

    CallRemoteFunction("OnPlayerCommandText", "ds", PlayerID, CMD);


    return true;
}
Reply
#7

Cara vlw mesmo, deu certinho os 2 comandos
Muito obrigado +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)