Scripting prob

Have a question you need to ask? Need help? Ask here!

Moderator: Core Staff

Post Reply
poseidon
CJ Wannabe
CJ Wannabe
Posts: 3
Joined: June 13th, 2014, 6:54 pm

Scripting prob

Post by poseidon » June 13th, 2014, 7:09 pm

Hi all i am new in the site :D (i like the phpbb style btw)
I want to ask for help in a scripting problem and i am newb at scripting :p
I was looking a topic here for how to make custom dvars
What i want is a dvar that will change the fov scale of the player that call it in b3 (for the ones that dont knows what b3 does is to send information to the console so the console must know who call it .That hear weird to me i tried a code last night i created the dvar witch is "promod" and it refers to "cg_fovscale,1.25" but when i write !promod what i see is that the command is execing in the start of a round and for all the players not the one who calls it pls help :D : (i edited the following)

Code: Select all

//B3 dvars
#include braxi\_dvar;
#include braxi\_admin;

init ( modVersion )
{

addDvar( "promod", "promod", 1, 0, 1, "int" );

if( level.dvar["promod"] == 1 )
thread promodview();

else

if( level.dvar["promod"] == 0 )
thread nopromodview();
}

promodview()
{
while ( 1 )
  {
level waittill("connected",player);
player thread view_on();
  }
}

nopromodview()
{
while ( 1 )
  {
  level waittill("connected",player);
  player thread view_off();
  }
}

view_on()
{

level waittill("connected",player);
self endon ( "disconnect" );
self endon ( "joined_specators" );
if( isDefined( player ) && player isReallyAlive() )
{
self setClientDvar("cg_fovscale",1.25);
self iPrintln("Promod View ^2[ON]");
}
}

view_off()
{

level waittill("connected",player);
self endon ( "disconnect" );
self endon ( "joined_specators" );
if( isDefined( player ) && player isReallyAlive() )
{
self setClientDvar("cg_fovscale",1);
self iPrintln("Promod View ^9[OFF]");
}
}
Note: its in Braxis deathrun mod
I have installed in b3 a deathrun plugin and have put the code :

Code: Select all

def cmd_promod(self, data, client, cmd=None):
    """\
    !promod - Gives a player a promod view.
       """
    self.console.write( 'promod 1' )
the plugin is this : http://ar51.eu/index.php?/files/file/35 ... plugin-b3/
Last edited by poseidon on June 15th, 2014, 12:53 pm, edited 3 times in total.

Pedsdude
Site Admin
Site Admin
Posts: 15908
Joined: October 15th, 2004, 7:18 pm
Location: UK

Re: Scripting prob

Post by Pedsdude » June 14th, 2014, 7:14 pm

Hi guys i am new so excuse my dumbness :p
I created two topics but they are nowhere i search it finds nothing even using advanced searching and "author" and my name
weird :shock:
This is an automatic feature to prevent bots from posting links/adverts. Your first few posts have to be approved by an admin/moderator, and then you can post as normal. I have cancelled your other posts which were a copy of this topic, and the quoted post above.
Image
Image

poseidon
CJ Wannabe
CJ Wannabe
Posts: 3
Joined: June 13th, 2014, 6:54 pm

Re: Scripting prob

Post by poseidon » June 15th, 2014, 12:39 pm

Ok thx . I didnt see it ,i saw it in the third topic that it needs aprooval :p

poseidon
CJ Wannabe
CJ Wannabe
Posts: 3
Joined: June 13th, 2014, 6:54 pm

Re: Scripting prob

Post by poseidon » June 20th, 2014, 1:50 pm

ok sry i solved it .
i have made admin commands in braxi/_admin
so b3 recognise it as : admin promod:"name"
and in b3 i have put : self.console.write( 'admin promod:%s' % (client.cid))

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests