thankyou
Donate to the B3 fund!

"even a small donation helps!"
Donate with PayPal!
Most of the plugins here are made by B3 users and the authors may not visit frequently. If you need support for plugins or if questions remain unanswered, you will have to contact the author directly. Read the full Support Disclaimer here

NOTE: Do not attach plugins to your forumtopics! Attachements are periodically removed by maintenance tasks. Upload your plugins to our Downloads section instead!

Author Topic: plugin request [cod4]  (Read 1719 times)

Offline hammah

  • Jr. Member
  • **
  • Posts: 16
plugin request [cod4]
« on: July 22, 2015, 06:59:51 PM »
hello, iam really new to the b3 plugin stuff but i want to have a plugin which is a command allowed for all players to use which enable or force dvars on themselves kinda like this  self setclientDvar ("r_fullbright","1");

what i mean is when a player type !fullbright he get the toggle full bright enabled can any one help me to get such a plugin.

thanks in advance

Offline hammah

  • Jr. Member
  • **
  • Posts: 16
Re: plugin request [cod4]
« Reply #1 on: July 22, 2015, 07:27:57 PM »
i searched around and i made this


Code: [Select]
init()
{
initializeCommands();
}
 
initializeCommands()
{
     addB3Command( "b3_fullbright", ::b3_fullbright );
}
addB3Command( dVarName, functionCall )
{
if ( !isDefined( level.b3Commands ) )
level.b3Commands = [];
newElement = level.b3Commands.size;
level.b3Commands[ newElement ] = [];
level.b3Commands[ newElement ]["dvar"] = dVarName;
level.b3Commands[ newElement ]["function"] = functionCall;
}

b3_fullbright()
{
 players = getentarray ("player", "classname");
for(i=0; i<players.size; i++)
    players[i] setclientDvar ("r_fullbright", "1");
}



will it work as a b3 command for all players ?

Offline Courgette

  • Senior Dev.
  • Hero Member
  • *
  • Posts: 4883
    • Github repository
Re: plugin request [cod4]
« Reply #2 on: July 22, 2015, 08:54:18 PM »
Take a look at the customcommand plugin. It might fit your case

Offline ph03n1x

  • Sr. Member
  • ****
  • Posts: 296
    • Lovers and Haters Urban Terror
Re: plugin request [cod4]
« Reply #3 on: July 22, 2015, 10:13:18 PM »
B3 actually interacts with the server settings, not the client settings. No way an rcon server-command can force client dvars as far as I know.

cu :)

Offline hammah

  • Jr. Member
  • **
  • Posts: 16
Re: plugin request [cod4]
« Reply #4 on: July 23, 2015, 12:34:58 AM »
some servers already got it working ?

Offline hammah

  • Jr. Member
  • **
  • Posts: 16
Re: plugin request [cod4]
« Reply #5 on: July 23, 2015, 12:39:30 AM »
they have commands like fps and fov etc but i am trying to make a different dvar

Offline hammah

  • Jr. Member
  • **
  • Posts: 16
Re: plugin request [cod4]
« Reply #6 on: July 23, 2015, 10:42:55 AM »
courgette will command like this work with your custom command plugin

fullbright = <PLAYER:PID> setclientDvar ("r_fullbright", "1");
« Last Edit: July 23, 2015, 10:45:40 AM by hammah »

Offline Courgette

  • Senior Dev.
  • Hero Member
  • *
  • Posts: 4883
    • Github repository
Re: plugin request [cod4]
« Reply #7 on: July 23, 2015, 01:51:36 PM »
if setclientDvar  is a legit cod4 rcon command, yes

Offline ph03n1x

  • Sr. Member
  • ****
  • Posts: 296
    • Lovers and Haters Urban Terror
Re: plugin request [cod4]
« Reply #8 on: July 23, 2015, 10:24:22 PM »
Nope, not as far as I know. That comes with a mod, forgot which one...might be promod...check it out.

Now your code in second post makes sense, that is how mods are coded...I think you are looking for a mod mate, not B3 plugin.

cu :)

 


Rate this page +1 at Google Search

anything