View Single Post
  #1  
Old 09-21-2011, 12:59 PM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
Server Weather Concept

I havnt expanded it much but im sure this will help someone
Anyway here you go.

Instructions:
Add as a weapon and add to yourself, then add the accounts you want to be able to change the weather in this.allowed and write /weather *Type*
the types are as followed.
Day, MidDay, Dusk, Night, MidNight, Dawn
Enjoy having a play around with this.
-Gunderak

PHP Code:
function onActionServerSide() {
  if (
params[0] == "changeweather") {
    
serverr.time params[1];
    
player.chat "Weather Set To: " params[1];
  }
}

//#CLIENTSIDE
function onCreated() {
  
this.allowed = {
    
"Graal780374","Graalblahblah"
  
};
  
onTimeout();
}

function 
onTimeout() {
  new 
GuiTextCtrl("Time") {
    
profile GuiBlueTextProfile;
    
height 20;
    
text serverr.time;
    
width 200;
    
60;
    
85;
    
red 1;
    
green 1;
    
blue 1;
    
hint "Health";
  }
  if (
serverr.time == "Night") {
    
seteffect(0000.8);
  }
  if (
serverr.time == "Day") {
    
seteffect(0000.2);
  }
  if (
serverr.time == "MidDay") {
    
seteffect(0.05000);
  }
  if (
serverr.time == "Dawn") {
    
seteffect(0.05000.6);
  }
  if (
serverr.time == "Dusk") {
    
seteffect(0.05000.6);
  }
  if (
serverr.time == "MidNight") {
    
seteffect(0000.9);
  }
  
Time.text serverr.time;
  
settimer(0.05);
}

function 
onPlayerchats() {
  if (
player.account in this.allowed) {
    if (
player.chat.starts("/weather")) {
      
triggerserver("weapon"this.name"changeweather"player.chat.substring(9));
    }
  }

__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote