View Single Post
  #1  
Old 08-10-2011, 09:53 AM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
Staff Song Player

Basically what it does is plays songs for everyone.
Only staff can use it, note if you want to thief this you need clientr.isStaff added to the players who can use it.
if there is any feedback or ideas for improvement please feel free to comment
i am also planning to make it into a gui which will be much nicer.

PHP Code:
function onActionServerSide(){
  if ( 
params[0] == "Setsong" ) {
  
serverr.song player.chat.substring(5);
  }
  if ( 
params[0] == "PlaySong" ) {
  for( 
pl allplayers ) {
  
pl.triggerclient("weapon"this.name"Play");
}
}
  if ( 
params[0] == "StopSong" ) {
  for( 
pl allplayers ) {
  
pl.triggerclient("weapon"this.name"Stop");
}
}
}
//#CLIENTSIDE
function onPlayerchats(){
if(
clientr.isStaff){
if(
player.chat == "/play"){
triggerserver("gui",this.name,"PlaySong");
}
if(
player.chat == "/stop"){
triggerserver("gui",this.name,"StopSong");
}
if(
player.chat.starts("/set")){
triggerserver("gui",this.name,"Setsong");
}
function 
onActionClientSide(){
if ( 
params[0] == "Play" ) {
play(serverr.song);
}
if ( 
params[0] == "Stop" ) {
play("none.mid");
}
}
}

__________________

Gund for president.

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