Author Topic: Small code question  (Read 1344 times)

I have no idea how to code tbh and I put some small thing together to test something I am going to do in the near future.
So I got my small code. (Totally not ripped from another code and changed stuff)
Code: [Select]
function servercmdtest(%client) {
messageclient(%client,'',"<color:ffffff>You have <var:cl:Test> Stone | And <var:cl:Test2> Iron");
return;
}
Now how do I make variables from VCE  appair in the chat thing?
Also is it possible to like a permanent bottomprint in the center? Kinda like a hud that shows how many thing you collected using  VCE.
I have no idea what I'm doing.

You might want to change the indentation first.

function servercmdtest(%client)
{
   messageclient(%client,'',"<color:ffffff>You have <var:cl:Test> Stone | And <var:cl:Test2> Iron");
   return;
}


In order to make a forever-lasting bottomprint on someone, do %client.bottomPrint("\c3Your message");.
You should replace <color:FFFFFFF> with \c6, which means white. Do /colortest ingame to find out the rainbow.
Since you already have the client represented by a variable, and you aren't using sounds, an easier way to do it is:

%client.chatMessage("\c6Your message here");

That's just my opinion. I'm not sure about VCE variables, but if they're anything like regular ones you should be able to access them through %client.variableName.

Look for filterVariableString in the VCE scripts, it does what you want but I'm not sure about the args

Look for filterVariableString in the VCE scripts, it does what you want but I'm not sure about the args
Looking off an example in something I did years ago, it looks like

%filteredText = filterVariableString(%unfilteredText,%brick,%client,%player);

Look for filterVariableString in the VCE scripts, it does what you want but I'm not sure about the args
Found allot of things: %name, %newvalue, %var, %valb, %vala and %args in the output file.
Also found function filterVariableString(%string,%brick,%client,%player,%vehicle) in replacers file.
Looking off an example in something I did years ago, it looks like

%filteredText = filterVariableString(%unfilteredText,%brick,%client,%player);
Thanks, I'll try it.

Also can do it like if a player join the minigame/spawns it displays.

Anyways I got it to work. But it doesn't really auto update. Wich sound logical.
Is it possible to auto update it by detecting a change in the client's variables?
« Last Edit: June 09, 2015, 11:07:16 AM by espio100 »

Is it possible to auto update it by detecting a change in the client's variables?
Package the function that changes the var (should be GameConnection::setVariable) and update the bottomprint if the variable you're looking for is changed

Package the function that changes the var (should be GameConnection::setVariable) and update the bottomprint if the variable you're looking for is changed
Ehh
You're speaking some kind of elvish I can't understand
again, I seriously have no idea what Im doing.
I hope Im not too much of a bother/idiot to you

Edit :You mean like function GameConnection::Setvariable();
Or something?
« Last Edit: June 09, 2015, 11:47:17 AM by espio100 »

Ehh
You're speaking some kind of elvish I can't understand
again, I seriously have no idea what Im doing.
I hope Im not too much of a bother/idiot to you

Edit :You mean like function GameConnection::Setvariable();
Or something?
function GameConnection::setVariable()
{
    //code

    parent::GameConnection::setVariable()
}

i think

-
Tried this
function GameConnection::onClientEnterGame(%c, %client, %filteredtext) {
   function GameConnection::setVariable() {
      %filteredText = filterVariableString(%unfilteredText,%brick,%client,%player);
      messageclient("\c6You got <var:cl:Test> Tests!");
      return;
      parent::GameConnection::setVariable()
   }   
}

Apperently the console log sais I got a syntax error on line 2.

w8 so u want a looping bottomprint w/ a vce variable in it?

w8 so u want a looping bottomprint w/ a vce variable in it?
I'm working on an rpg thing and I'm using VCE for currency/items, etc... And I want it to show up at the bottom. Has to be there permanently and it has to automticly update when the variable changes. Kind of what you said.
I changed a bit of the code while looking trough other codes how to do stuf but didn't bother posting since I would like a script kiddie. Wich I am right now actually.

Also can I change oncliententergame to oncliententerminigame?

http://scatteredspace.com/forum/index.php?PHPSESSID=1994b48957c40dc64c1ecf56faf4e2c9&topic=2528.0 << that thing is pretty much exactly wat ur looking for

function chipotleBar(%client)
{
  cancel($chipotlenessbar);
  bottomPrintAll("what the foobar did you just say about me, " @ %client.dosh @ "?");
  $chipotlenessbar= schedule(timehere,0,chipotleBar);
}

^that does what ur looking 4 but you gotta find some1 else 4 the variables
« Last Edit: June 09, 2015, 01:29:45 PM by Hawt »

-
Eh?
Can you explain exactly what it does or how it works?
What is that chipotlebar thing even?
« Last Edit: June 09, 2015, 01:46:01 PM by espio100 »

Eh?
Can you explain exactly what it does or how it works?
What is that chipotlebar thing even?
the global variables and the chipotleBar are placeholders, you can change them
i literally just searched for the code and found this

I changed a bit of the code while looking trough other codes how to do stuf but didn't bother posting since I would like a script kiddie. Wich I am right now actually.
Post it anyway. Copying bits from other code is a good way to get started.