PDA

View Full Version : RC on Player's Client


gamer4lifebitach
08-24-2006, 07:20 PM
I need help im trying to make an RC for like faq's and et's gp's so they dont really need to get access from normal rcs and i just want to make one for fun too so ya please help.

// NPC Made By *Devenio
//#CLIENTSIDE
function onCreated(){
new GuiWindowCtrl("RC_Window") {
RC_Window.destroy();
}
thiso.rcchat = {"Test","Test","Test","Test","Test","Test","Test","Test","Test","Test"};
}
function onWeaponfired(){
RC_Window.destroy();
new GuiWindowCtrl("RC_Window") {
text = "Remote Control 2006/08/24 - By *Devenio";
profile = "RC_Window";
x=0;
y=0;
width = 510;
height = 385;
destroyonhide = true;
canresize = false;
canclose = true;
canminimize = true;
canmaximize = false;
new GuiTextEditCtrl("RC_Chatbar") {
profile = "RC_Chatbar";
x=5;
y=360;
width = 500;
height = 20;
}
new GuiScrollCtrl("RC_Scrollbar") {
profile = "RC_Scrollbar";
x=484;
y=190;
width = 20;
height = 170;
}
new GuiTextListCtrl("RC_Chat") {
profile = "RC_Chat";
x=15;
y=195;
for (a: thiso.rcchat) {
RC_Chat.addRow(0,a);
}
}
}
}

gamer4lifebitach
08-24-2006, 11:01 PM
How do i make a red box show up where you cant dont anything to it but its inside a guiwindow already, and it goes behind text like the text box in the RC2???

Skyld
08-24-2006, 11:17 PM
I need help im trying to make an RC for like faq's and et's gp's so they dont really need to get access from normal rcs and i just want to make one for fun too so ya please help.
Well, depending on what you want your Client RC to do, you have two options.

Use clientrc stuff, which provides the player with the ability to edit attributes, scripts, server flags etc. However, clientrc requires the player to have a normal RC.
Script your own routines for controlling players and such, but you will not be able to access anything RC-like.

Chris
08-24-2006, 11:27 PM
RC for fun? Uhh that isn't good. Plus, how did your account name ever get approved?

gamer4lifebitach
08-25-2006, 01:12 AM
if you dont like my account well than i dont care, next i want my rc to act like a normal rc (so i go with #1)

ApothiX
08-25-2006, 11:18 AM
Few things I see wrong with your code right off the bat.

new GuiWindowCtrl("RC_Window") {
RC_Window.destroy();
}
This should be:
if(RC_Window != NULL) RC_Window.destroy();

[php]thiso.rcchat = {"Test","Test","Test","Test","Test","Test","Test","Test","Test","Test"};
You are not in the scope of another object, so you do not use thiso. like that. It should be: this.rcchat = ...

RC_Window.destroy();
You'll get console errors like mad (especially if this is your first time firing the weapon since it was updated.) Use the method I said previously to destroy the window.

new GuiWindowCtrl("RC_Window") {
profile = "RC_Window";
Read the wiki to understand what profiles are. Setting the profile to the window which you are creating will result in some nasty effects. (This goes for all of the other controls you created aswell.)

new GuiScrollCtrl("RC_Scrollbar") {
// ..
}
new GuiTextListCtrl("RC_Chat") {
}
You need to embed the second control in the first (this applies for the comment after this one, too)
new GuiScrollCtrl("RC_Scrollbar") {
// ..
new GuiTextListCtrl("RC_Chat") {
// ..
}
}


new GuiTextListCtrl("RC_Chat") {
You should be using a GuiMLTextCtrl for the chat box. It will be less hassel, and it will give you that red box behind the text.


And something wrong with your attitude:
if you dont like my account well than i dont care
Your account name MAY be offensive to other people. In the case that it is, you should not react by telling them you don't care. Act like that and people will request deletion of your account by an admin. (You really should read the account creation rules before you create an account, anyway.)