[Ayuda] CallRemoteFunction...
#1

Buenas a todos, hice un comando /comando [id] y kiero forzar al id selecionado a utilizar tal comando, utilizando la funcion CallRemoteFunction pero no me funciona, alguien me puede ayuda.

asi he colocado y no funciona:
Код:
CallRemoteFunction("OnPlayerCommandText", "is", jugadorid, "/comando");
Desde ya muchas gracias.
Reply
#2

No se puede porque los comandos van del lado del cliente.
Reply
#3

Pero, no veo la nesesida de usar un calllocal si puedes crear ese comando como una funciуn y esa funciуn llamarla y listo -.-!
Reply
#4

pawn Код:
OnPlayerCommandText(jugadorid, "/comando");
Reply
#5

Quote:
Originally Posted by TiNcH010
Посмотреть сообщение
pawn Код:
OnPlayerCommandText(jugadorid, "/comando");
no, funciona asi, eso esl o primero ke hice :S
Reply
#6

Basate en el comando fakecmd del ladmin... aunque talvez ya lo estes haciendo.

pawn Код:
dcmd_fakecmd(playerid,params[]) {
    if(PlayerInfo[playerid][Level] >= 3) {
        new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
        if(!strlen(tmp) || !strlen(tmp2)) return SendClientMessage(playerid, red, "USAGE: /fakecmd [playerid] [command]");
        new player1 = strval(tmp);
        if(PlayerInfo[player1][Level] == ServerInfo[MaxAdminLevel] && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin");
        if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
            CMDMessageToAdmins(playerid,"FAKECMD");
            CallRemoteFunction("OnPlayerCommandText", "is", player1, tmp2);
            return SendClientMessage(playerid,blue,"Fake command sent");
        } else return SendClientMessage(playerid,red,"ERROR: Player is not connected");
    } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}
Reply
#7

el comando que estas forzando a usar a el player, esta en el mismo script del comando que usas para forzarlo ?
Reply
#8

Si estб en el mismo script del comando ( como dice Jovanny ), tenes que usar CallLocalFunction
Reply
#9

el comando esta el cliente, es el /quit pero tambien lo kiero hacer con otros ke estaran en el GM y la funcion ke forzara al user estaran el gm tambien.

ya intente con CallLocalFunction("OnPlayerCommandText", "is", i, "/quit"); y CallRemoteFunction("OnPlayerCommandText", "is", i, "/quit"); y nada, me salen como ke no existe el comando :S.
Reply
#10

A poner /quit no lo podes forzar, es un comando del cliente, no programado por vos. Podes programar un auto-kick y llamar a ese.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)