Jump to content
  • 0

Comanda remote control


TheGodfather

Question

Salut, ma puteti ajuta cu o comanda prin care ceea ce scriu eu sa se aplice altui jucatori? De exemplu, /remotecommand <remote player> <command text>, /remotecontrol 206 /engine, ii opreste/porneste motorul playerului cu id 206, /remotecontrol 206 /eject 50, playerul cu id 206 ii da eject din masina playerului cu id 50.

Am incercat asta dar nu merge, am incercat sa apelez si OnPlayerCommandPerformed dar tot nu merge.

YCMD:remotecontrol(playerid, params[], help) {
    if(aspam[playerid] > 0) return SCMEx(playerid, COLOR_LIGHTRED, "[Command Anti-Spam] {FFFFFF}Asteapta %d secunde.", aspam[playerid]);
    new id, text[30];
    if(sscanf(params, "is[30]", id, text)) return SCM(playerid, COLOR_GREY, "Syntax: {FFFFFF}/remotecontrol <playerid> <command>");
    OnPlayerCommandReceived(id, text);
    return 1;
}

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Daca folosesti y_commands, trebuie sa pui

Command_ReProcess(id, text, false);

in loc de
 

OnPlayerCommandReceived(id, text);

Si apoi o folosesti dupa exemplul urmator: /remotecontrol Akan /gotols - Asta ma face pe mine sa dau /gotols automat. Si o poti folosi si cu parametri: /remotecontrol Akan /gethere Akan - Asta ma face pe mine sa-mi dau /gethere singur.

Si modifica si tu if(sscanf(params, "is[30]", id, text)) in if(sscanf(params, "us[30]", id, text)) ca sa poti folosi comanda asta pe un jucator si dupa numele lui, nu doar dupa id-ul lui. Succes.

Edited by Akan

Discord:
! Akan !#6675

Link to comment
Share on other sites

  • 0
6 hours ago, Akan said:

Daca folosesti y_commands, trebuie sa pui

Command_ReProcess(id, text, false);

in loc de
 

OnPlayerCommandReceived(id, text);

Si apoi o folosesti dupa exemplul urmator: /remotecontrol Akan /gotols - Asta ma face pe mine sa dau /gotols automat. Si o poti folosi si cu parametri: /remotecontrol Akan /gethere Akan - Asta ma face pe mine sa-mi dau /gethere singur.

Si modifica si tu if(sscanf(params, "is[30]", id, text)) in if(sscanf(params, "us[30]", id, text)) ca sa poti folosi comanda asta pe un jucator si dupa numele lui, nu doar dupa id-ul lui. Succes.

Multumesc frumos, functioneaza perfect.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.