Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Radíowave

Pages: [1] 2 3 4 5 6 ... 9
1
Modification Help / Re: Finding specific word within variable
« on: August 21, 2016, 03:17:33 AM »
For some reason the function 'removeWord' doesn't seem to be working for me...
I even tested it out and messed with it in-game and it won't erase any words. ???

2
Modification Help / Re: Finding specific word within variable
« on: August 21, 2016, 02:54:28 AM »
Thank you, very useful!

3
seems like a real richard.

User was banned for this post

4
Modification Help / Re: Parent Delay
« on: January 18, 2016, 05:05:36 PM »
Code: [Select]
OH! silly me! I had forgotten to put the function inside of the package... also I added
the light detector to the other function.
[code]
package hasLight{
function serverCmdLight(%client){
schedule(5000,0,lightParent,%client);
}
function lightParent(%client){
if(!%client.hasLight){
%client.hasLight = true;
}
else{
%client.hasLight = false;
}
parent::serverCmdLight(%client);
}
};
activatePackage(hasLight);
now... how would I make it so that they can't spam the light button and mess it up?

EDIT: Oh, nvm. I discovered the wonders of sim time[/code]

5
Modification Help / Re: Parent Delay
« on: January 18, 2016, 02:54:04 PM »
Ok, so I did
Code: [Select]
package hasLight{
function serverCmdLight(%client){
if(!%client.hasLight){
%client.hasLight = true;
}
else{
%client.hasLight = false;
}
schedule(5000,0,lightParent,%client);
}
};
activatePackage(hasLight);

function lightParent(%client){
parent::serverCmdLight(%client);
}
It delays the 5 seconds but in the console it's saying that the serverCmdLight function doesn't exist.

6
Modification Help / Parent Delay
« on: January 18, 2016, 02:03:59 PM »
Code: [Select]
package hasLight{
function serverCmdLight(%client){
if(!%client.hasLight){
%client.hasLight = true;
}
else{
%client.hasLight = false;
}
schedule(5000,0,parent::serverCmdLight(%client));
}
};
activatePackage(hasLight);
So basically this code detects whether or not a player has their light out..
what I'm TRYING to make it do is have a 5 second delay so that it takes
5 seconds to turn it on/off. For some reason that won't work... how can
I fix this? Also, do I need my own code to detect players' lights? I feel like
there was already some code written in for that. If so, what is it?

7
Modification Help / Function to get current FOV?
« on: January 14, 2016, 03:40:45 PM »
What's the function to get your current FOV?

8
Modification Help / Re: Add item to player
« on: January 03, 2016, 03:55:16 PM »
This is the function used for Event_addItem
Code: [Select]
function Player::addItem(%player,%image,%client)
{
   for(%i = 0; %i < %player.getDatablock().maxTools; %i++)
   {
      %tool = %player.tool[%i];
      if(%tool == 0)
      {
         %player.tool[%i] = %image;
         %player.weaponCount++;
         messageClient(%client,'MsgItemPickup','',%i,%image);
         break;
      }
   }
}
Using this, I did this in the console:
Player::addItem(findClientByName("BigNaeyt").player, "GunItem", findClientByName("BigNaeyt"));

This causes the item to appear in my tools, but for some reason I can't scroll over it. Ideas?

9
Modification Help / Add item to player
« on: January 02, 2016, 09:34:15 PM »
All I want to know is how to add an item, tool, or weapon to a player. For some reason I'm actually
having a difficult time figuring this out, maybe it's harder than it sounds?

10
Modification Help / Re: VCE Variables Help
« on: January 01, 2016, 05:02:32 PM »
Try %client.brickGroup.varGroup.getVariable("player", "money", %client.player);

I wouldn't suggest mixing VCE with scripting though. You should just do one or the other.
Yeah, after looking at that I think it would be easier to just make my own events and store variables my own way.

11
Modification Help / VCE Variables Help
« on: January 01, 2016, 04:27:02 PM »
The VCE add-on has on option to add variables to a player. (through events)

onActivate > Player > VCE_modVariable > (variable here: money) > Add > (amount)

The only way I know how to display it is by using events.

onActivate > Client > CenterPrint > <var:pl:money>

How would I display the amount of 'money' I have through a function such as announce or echo?

I was trying
Code: [Select]
announce(findClientByName("playername").money); but that obviously didn't work.


12
Modification Help / Re: Specifying a client's team
« on: December 30, 2015, 07:29:30 PM »
%client.getTeam().getName() was it?
I tried that out, it doesn't seem to work. That line is definitely reasonable though

13
Modification Help / Specifying a client's team
« on: December 30, 2015, 06:41:26 PM »
How do I get somebody's team name? What I'm trying to do is allow people to use a command
ONLY if they're on a specific team.

14
Modification Help / Re: Bots and vehicles
« on: December 25, 2015, 10:13:08 AM »
I'm sure you can do this using just events...

15
Modification Help / Saving variables using export function
« on: December 25, 2015, 09:55:29 AM »
I need to be able to save variables/info that won't erase after I shutdown my server. I know how to create and
have it write in a .txt file, but from what I'm hearing, this way is more efficient to use.

This is the demonstration we'll work with:
Code: [Select]
function serverCMDaddMoney(%client, %target, %amount)
{
%targ = findClientByName(%target);

        //Just checking things here...
if(!%client.isSuperAdmin)
{
return;
}
if(!isObject(%targ))
{
%client.chatMessage("Invalid client!");
return;
}
if(%amount <= 0)
{
%client.chatMessage("Invalid amount!");
return;
}

%targ.money = %targ.money + %amount;
announce("\c3"@%targ.name@" \c6has gained \c2$"@%amount);
}
As shown, the function has the ability to add 'money' to a client. Now all I need is for it to save
so that they'll still have their money when the server restarts (or when they leave and come back).

Pages: [1] 2 3 4 5 6 ... 9