SA-MP Forums Archive
Force a player to run a command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Force a player to run a command (/showthread.php?tid=582273)



Force a player to run a command - BigBrainAFK - 19.07.2015

Hello,

I want to force a player that joins to run the /audiomsg command so they don't see the audio stream urls.

Is there a way to force a player to run a specific command?


Re: Force a player to run a command - Glenn332 - 19.07.2015

Quote:
Originally Posted by BigBrainAFK
Посмотреть сообщение
Hello,

I want to force a player that joins to run the /audiomsg command so they don't see the audio stream urls.

Is there a way to force a player to run a specific command?
Using yini commands
Command_ReProcess(player, "/audiomsg", false);


AW: Force a player to run a command - BigBrainAFK - 19.07.2015

Is there a way without yini commands?


Re: Force a player to run a command - Glenn332 - 19.07.2015

You can put the contents of /audiomessage into a new public and set it to both the command and OnPlayerConnect?


AW: Force a player to run a command - BigBrainAFK - 19.07.2015

Well it's a client side command so I don't know if it will work.


Re: Force a player to run a command - Glenn332 - 19.07.2015

Ah well I never knew that existed :P
Ehm no I dont see any other way than using the yini thing but maybe someone else can think of something!


Re: Force a player to run a command - SilentSoul - 19.07.2015

Try this one - https://sampforum.blast.hk/showthread.php?pid=3489218#pid3489218


EDIT:
Sorry, didn't read your topic carefully, i don't think its possible because its a client side so he have to type it himself.


AW: Force a player to run a command - BigBrainAFK - 19.07.2015

Well thats just forcing a player to run zcmd commands. This won't work for native client sided commnds I guess.


Re: Force a player to run a command - gurmani11 - 19.07.2015

if you are using zcmd then this

pawn Код:
CMD:forceradio (playerid, params[])
{
    new str[128], id, input;
    if(sscanf(params, "ui", id,input)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /forceradio [ID][1,2,3]");
    if(!IsPlayerConnected(id))  return SendClientMessage(playerid, COLOR_RED, "Player is not connected!");
    if(playerid == id)return SendClientMessage(playerid, COLOR_NORMALBLUE, "You forced yourself to to play a radio");
    SendClientMessage(playerid,-1,"You forced a player to play a radio!");
    SendClientMessage(id,-1,"You were forced by an admin to play a radio!");
    cmd_audiomsg(id,input);
    return 1;
}



Re: Force a player to run a command - Virtual1ty - 19.07.2015

You can not force the player to hide those messages. They could still find out somehow, and players should know what material you're streaming so there's really no point in hiding that.