Author Topic: Problem about a script I made. :O  (Read 2406 times)

When I tried it, it didn't work. Can someone tell me what I made wrong?

It's in attached files.


When I tried it, it didn't work.
It's Rikard's fault... :cookieMonster:
Thanks, you're the first who followed my rule! xD

When I tried it, it didn't work.
It's Rikard's fault... :cookieMonster:
Thanks, you're the first who followed my rule! xD
Hai I wrote those rules on your server D:

But it's my server, and your rules = MY RULEZ! (And yours)

Code: [Select]
messageClient(%client,'',"message");You're missing the %client; you aren't sending the message to anyone!

Quote
package Runeth
{
   function GameConnection::SpawnPlayer(%client)
   {
      MessageClient(%client,'',"\c2Welcome to \c0Runeth's PPT server. \c3Runeth\c2 last name was \"Hooga the Pirate\" if you didn't know."); //Make sure you send the message to someone + fixed quotes so they work
      MessageClient(%client,'',"\c2Runeth isn't the leader of PPT, \c3Jervan\c2 is!. Respect all Admins/Super Admins and have fun."); //Fixed grammar and position of colours
      Parent::spawnPlayer(%client); //Actually spawn the player
   }
   function serverCmdMessageSent(%client,%message)
   {
      if(%message $= "runeth sucks") //$= is strings. == is numbers only but faster
      {
         %client.player.kill(); //Kill the player
         messageAll('',"\c7SHP.\c3Runeth\c7.PPT\c6: Hell no! You're the one who sucks, " @ %client.name @ "!"); //Slight fix to the message
          //type return; if you don't want the message to be displayed
      }
      Parent::serverCmdMessageSent(%client,%message);
   }
};
ActivatePackage(Runeth);
Fixed, shown the changes made in bold. (Italic/Comments are explaining them)

I also changed the colours to green and yellow instead of green and red since they fit better :cookieMonster:

Uhm, in some of the messages you left ' in the strings when I believe it should be \'

Er, thats only a problem if the string is within ' ' also. The strings in this example are within " ".


Although it probably would have been better to use ' '
« Last Edit: May 19, 2008, 06:59:17 PM by exidyne »

Quote
package Runeth
{
   function GameConnection::SpawnPlayer(%client)
   {
      MessageClient(%client,'',"\c2Welcome to \c0Runeth's PPT server. \c3Runeth\c2 last name was \"Hooga the Pirate\" if you didn't know."); //Make sure you send the message to someone + fixed quotes so they work
      MessageClient(%client,'',"\c2Runeth isn't the leader of PPT, \c3Jervan\c2 is!. Respect all Admins/Super Admins and have fun."); //Fixed grammar and position of colours
      Parent::spawnPlayer(%client); //Actually spawn the player
   }
   function serverCmdMessageSent(%client,%message)
   {
      if(%message $= "runeth sucks") //$= is strings. == is numbers only but faster
      {
         %client.player.kill(); //Kill the player
         messageAll('',"\c7SHP.\c3Runeth\c7.PPT\c6: Hell no! You're the one who sucks, " @ %client.name @ "!"); //Slight fix to the message
          //type return; if you don't want the message to be displayed
      }
      Parent::serverCmdMessageSent(%client,%message);
   }
};
ActivatePackage(Runeth);
Fixed, shown the changes made in bold. (Italic/Comments are explaining them)

I also changed the colours to green and yellow instead of green and red since they fit better :cookieMonster:
Thanks man, you're cool!

Code: [Select]


package Runeth
{
   function GameConnection::SpawnPlayer(%client)
   {
      MessageClient(%client,'',"\c2Welcome to \c0Runeth\'s PPT server. \c3Runeth\c2 last name was \"Hooga the Pirate\" if you didn\'t know.");
      MessageClient(%client,'',"\c2Runeth isn\'t the leader of PPT, \c3Jervan\c2 is!. Respect all Admins/Super Admins and have fun.");
      Parent::spawnPlayer(%client);
   }
   function serverCmdMessageSent(%client,%message)
   {
      if(%message $= "runeth sucks") //$= is strings. == is numbers only but faster
      {
         %client.player.kill();
         messageAll('',"\c7SHP.\c3Runeth\c7.PPT\c6: Hell no! You're the one who sucks, " @ %client.name @ "!");
          //type return; if you don't want the message to be displayed
      }
      Parent::serverCmdMessageSent(%client,%message);
   }
};
ActivatePackage(Runeth);




What did you actually change there, apart from adding \' marks which aren't needed in " " quotes and removing the comments which explained how it actually worked?