SA-MP Forums Archive
[Ayuda] CallRemoteFunction... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: [Ayuda] CallRemoteFunction... (/showthread.php?tid=331314)



[Ayuda] CallRemoteFunction... - OTACON - 04.04.2012

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.


Respuesta: [Ayuda] CallRemoteFunction... - iKeN - 04.04.2012

No se puede porque los comandos van del lado del cliente.


Respuesta: [Ayuda] CallRemoteFunction... - LuisGraph - 04.04.2012

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 -.-!


Respuesta: [Ayuda] CallRemoteFunction... - TiNcH010 - 04.04.2012

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



Respuesta: [Ayuda] CallRemoteFunction... - OTACON - 04.04.2012

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


Re: [Ayuda] CallRemoteFunction... - dis77urbio - 05.04.2012

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");
}



Respuesta: [Ayuda] CallRemoteFunction... - Jovanny - 05.04.2012

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


Respuesta: [Ayuda] CallRemoteFunction... - [J]ulian - 05.04.2012

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


Respuesta: [Ayuda] CallRemoteFunction... - OTACON - 07.04.2012

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.


Respuesta: [Ayuda] CallRemoteFunction... - [J]ulian - 07.04.2012

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.