View Single Post
  #1  
Old 08-06-2012, 12:31 AM
Fysez Fysez is offline
Banned
Join Date: Apr 2012
Posts: 89
Fysez has a little shameless behaviour in the past
Feedback Scipt - Help

So I'm having a bit of a problem understanding how to store information into a weapon script.
I have made a simple Feedback script, But the problem is that I'm having troubles learning how to keep the added rows.
For example:

When i'm Online:
(Someone uses feedback) >
(I manage feedback) >
(It shows up).

When i'm Offline:
(Someone uses feedback) >
(I get on to manage feedback) >
(It does not show up).

Same with if I relog (of course).

So I need help LEARNING how to store information like this, as I have never done it before.

PHP Code:
function onActionServerSide() {
  if (
params[0] == "fsend") {
    for(
temp.pl : allplayers) {
      
temp.pl.triggerclient("gui",this.name,"fendt", params[1]);
    }
  }
}

//#CLIENTSIDE
function onActionClientSide() {
  if (
params[0] == "fendt") {
    
Feedback_List.addrow(0, params[1]);
  }
}

function 
onCreated() {
  
join("Feedback_Memory");
  
this.fon = false;
  
this.mprs = false;
  
this.Admins = {"Graal781471", "dylan"};
}

function 
onKeyPressed(Code,Key) {
  if (
Key == "o" || Key == "O") {
    if (
this.fon == false) {
      
this.fon = true;
      
onFeedBackShow();
      
player.chat = "Feedback Test On!";
    } else if (
this.fon == true) {
      
this.fon = false;
      
onFeedBackClose();
      
player.chat = "Feedback Test Off!";
    }
  }
}

function 
onFeedBackShow() {
  
this.mprs = false;
  
onFeedBack();
  
Feedback_Window1.show();
  
Feedback_Checkbox1.show();
  
Feedback_Text1.show();
  
Feedback_Button1.show();
  
Feedback_Button2.show();
  
Feedback_TextList1.show();
  
Feedback_List.hide();
}

function 
onFeedBackClose() {
  
this.mprs = false;
  
onFeedBack();
  
Feedback_Window1.hide();
  
Feedback_Checkbox1.hide();
  
Feedback_Text1.hide();
  
Feedback_Button1.hide();
  
Feedback_Button2.hide();
  
Feedback_TestList1.hide();
  
Feedback_List.hide();
}

function 
onFeedBack() {
  new 
GuiWindowCtrl("Feedback_Window1") {
    
profile = GuiBlueWindowProfile;
    
clientrelative = true;
    
clientextent = "172,53";

    
canclose = false;
    
width = 400;
    
height = 100;
    
canmaximize = false;
    
canminimize = false;
    
canmove = false;
    
canresize = true;
    
closequery = false;
    
destroyonhide = false;
    
text = "             Feedback";
    
x = 610;
    
y = 261;
  new 
GuiCheckBoxCtrl("Feedback_CheckBox1") {
    
profile = GuiBlueCheckBoxProfile;
    
height = 30;
    
width = 100;
    
text = "Feedback Sent";
    
x = 5;
    
y = 5;
    
checked = false;
  }
  new 
GuiTextEditCtrl("Feedback_Text1") {
    
profile = "GuiBlueTextEditProfile";
    
horizSizing = "width";
    
vertSizing = "top";
    
position = "100 370";
    
x = 5;
    
y = 35;
    
width = 10;
    
extent = "360 25";
    
historySize = 100;
    
tabComplete = true;
  }
  new 
GuiButtonCtrl("Feedback_Button1") {
    
profile = GuiBlueButtonProfile;
    
height = 24;
    
text = "Send";
    
width = 100;
    
x = 265;
    
y = 5;
  }
  new 
GuiButtonCtrl("Feedback_Button2") {
    
profile = GuiBlueButtonProfile;
    
height = 24;
    
text = "Manage Feedback";
    
width = 125;
    
x = 115;
    
y = 5;
  }
    new 
GuiTextListCtrl("Feedback_List") {
      
profile = GuiBlueTextListProfile;
      
height = 53;
      
horizsizing = width;
      
width = 1500;
      
sortmode = "name";
      
sortorder = "ascending";
      
x = 50;
      
y = 35;
      
sort();
    }
  }
}

function 
Feedback_Button1.onAction() {
  if (
Feedback_CheckBox1.checked == true) {
    
triggerserver("gui",this.name,"fsend", Feedback_Text1.text);
    
onFeedBack();
    
Feedback_List.hide();
    
Feedback_Text1.text = "";
    
Feedback_CheckBox1.checked = false;
  } else {
    
onFeedBackClose();
    
this.fon = false;
    
player.chat = "I need to press the checkmark first!";
  }
}

function 
Feedback_Button2.onAction() {
  if (
player.account in this.Admins) {
    
this.mprs = true;
    
player.chat = "Managing Feedback...";
    
onFeedBack();
    
Feedback_Window1.height = 150;
    
Feedback_List.show();
  } else {
    
player.chat = "I don't have read rights!";
  }
}

function 
onPlayerChats() {
  if (
player.chat.starts("/clearfeedback")) {
    if (
player.account in this.Admins) {
      
player.chat = "I have cleared "@ addrows(0) @" feedback!";
      
onFeedBack();
      
Feedback_List.clearrows();
    } else {
      
player.chat = "I am not authorized!";
    }
  }
} 
THANKS!
-Fysez

EDIT: Sorry just noticed it says "scipt"

Last edited by Fysez; 08-06-2012 at 12:57 AM.. Reason: Lol@Title
Reply With Quote