SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 19/07/2015, 01:21 PM   #1
BigBrainAFK
Big Clucker
 
Join Date: Mar 2014
Location: Germany
Posts: 74
Reputation: 3
Default Force a player to run a command

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?
__________________
Quote:
"And are we meant to guess your code?"
- Y Less
BigBrainAFK is offline   Reply With Quote
Old 19/07/2015, 01:23 PM   #2
Glenn332
Big Clucker
 
Join Date: Jun 2013
Location: NL- DUTCHLANDS
Posts: 116
Reputation: 12
Default Re: Force a player to run a command

Quote:
Originally Posted by BigBrainAFK View Post
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);
Glenn332 is offline   Reply With Quote
Old 19/07/2015, 01:26 PM   #3
BigBrainAFK
Big Clucker
 
Join Date: Mar 2014
Location: Germany
Posts: 74
Reputation: 3
Default AW: Force a player to run a command

Is there a way without yini commands?
__________________
Quote:
"And are we meant to guess your code?"
- Y Less
BigBrainAFK is offline   Reply With Quote
Old 19/07/2015, 01:29 PM   #4
Glenn332
Big Clucker
 
Join Date: Jun 2013
Location: NL- DUTCHLANDS
Posts: 116
Reputation: 12
Default Re: Force a player to run a command

You can put the contents of /audiomessage into a new public and set it to both the command and OnPlayerConnect?
Glenn332 is offline   Reply With Quote
Old 19/07/2015, 01:32 PM   #5
BigBrainAFK
Big Clucker
 
Join Date: Mar 2014
Location: Germany
Posts: 74
Reputation: 3
Default AW: Force a player to run a command

Well it's a client side command so I don't know if it will work.
__________________
Quote:
"And are we meant to guess your code?"
- Y Less
BigBrainAFK is offline   Reply With Quote
Old 19/07/2015, 01:45 PM   #6
Glenn332
Big Clucker
 
Join Date: Jun 2013
Location: NL- DUTCHLANDS
Posts: 116
Reputation: 12
Default Re: Force a player to run a command

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!
Glenn332 is offline   Reply With Quote
Old 19/07/2015, 04:04 PM   #7
SilentSoul
Gangsta
 
Join Date: Aug 2013
Posts: 810
Reputation: 65
Default Re: Force a player to run a command

Try this one - http://forum.sa-mp.com/showthread.php?p=3489218


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.
SilentSoul is offline   Reply With Quote
Old 19/07/2015, 04:14 PM   #8
BigBrainAFK
Big Clucker
 
Join Date: Mar 2014
Location: Germany
Posts: 74
Reputation: 3
Default AW: Force a player to run a command

Well thats just forcing a player to run zcmd commands. This won't work for native client sided commnds I guess.
__________________
Quote:
"And are we meant to guess your code?"
- Y Less
BigBrainAFK is offline   Reply With Quote
Old 19/07/2015, 05:19 PM   #9
gurmani11
Huge Clucker
 
gurmani11's Avatar
 
Join Date: Dec 2012
Location: Lucid Dreams
Posts: 354
Reputation: 18
Default Re: Force a player to run a command

if you are using zcmd then this

pawn Code:
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;
}
gurmani11 is offline   Reply With Quote
Old 19/07/2015, 05:48 PM   #10
Virtual1ty
Banned
 
Join Date: Jun 2009
Location: Croatia (Hrvatska)
Posts: 735
Reputation: 102
Default Re: Force a player to run a command

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.
Virtual1ty is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Force player to.. [rG]Cold Scripting Help 6 26/10/2014 12:39 AM
How to force player to write a command? Micius Scripting Help 1 17/07/2013 07:31 PM
is there a way to force a player to surf a vehicle? / and / Is player aiming? aNdReSk Help Archive 2 18/07/2010 08:55 AM
Force player into car kylebrown Help Archive 10 09/12/2009 11:48 PM


All times are GMT. The time now is 05:16 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.