Blockland Forums > Modification Help

Call of Duty Mod NEED HELP!

Pages: << < (2/4) > >>

::Matt:::

Wait a second, I have another problem... On line 9 I have a problem. When the killer kills a player, the killer doesn't get the message, the player that is killed gets it. I tried



--- Code: ---     if(%killer.kills > 1 && %killer.kills < 20)
         centerPrint(%killer, "<color:FFFFFF>+<color:00FF00>50", 2);
--- End code ---

And...

   
--- Code: ---  if(%killer.kills > 1 && %killer.kills < 20)
         centerPrint(%killerPlayer, "<color:FFFFFF>+<color:00FF00>50", 2);
--- End code ---

There seems to be many bugs o_O

Kilser:

Wow, could I get my hands on thes script after?

::Matt:::


--- Quote from: Kilser on January 30, 2011, 05:31:52 AM ---Wow, could I get my hands on thes script after?

--- End quote ---

I'll put it on either the forums or RTB afterwords, so sure lol. But don't copy pasta or I'll find you -.-

Greek2me:


--- Quote ---RTB_registerPref("Enable Nuke Script", "Nuke Script", "$ScriptNuke::Enable", "bool", "Script_Nuke", false, true, false, "");
package Nuke {
   function gameConnection::onDeath(%client, %killerPlayer, %killer, %damageType, %a) {
      Parent::onDeath(%client, %killerPlayer, %killer, %damageType, %a);
        if(!$ScriptNuke::Enable)
           return;
      %client.kills = 0;
      if(%client $= %killer)
         return;
      %killer.kills++;
      if(%killer.kills > 1 && %killer.kills < 20)
         centerPrint(%client, "<color:FFFFFF>+<color:00FF00>50", 2);
      else if(%killer.kills >= 20) {
         messageAll('',"<color:FFFF00>"@%killer.name@"<color:FFFFFF> got the nuke!");
         if(isObject(%mini = %killer.miniGame))
            %mini.reset(%mini.owner);
      }
   }
};
activatePackage(Nuke);
--- End quote ---

Bold are my changes.

[*]You can't have a / in a variable. / is used for divide
[*]You can't just add the RTB pref, you need a check to see if the mod is enabled.

Bauklotz:


--- Code: ---RTB_registerPref("Enable Nuke Script", "Nuke Script", "pref::scriptNuke::enable", "bool", "Script_Nuke", false, true, false, "");
package Nuke {
   function gameConnection::onDeath(%client, %killerPlayer, %killer, %damageType, %a) {
      Parent::onDeath(%client, %killerPlayer, %killer, %damageType, %a);
        if(!$pref::scriptNuke::enable)
           return;
      %client.kills = 0;
      if(%client $= %killer)
         return;
      %killer.kills++;
      if(%killer.kills > 1 && %killer.kills < 20)
         centerPrint(%client, "<color:FFFFFF>+<color:00FF00>50", 2);
      else if(%killer.kills >= 20) {
         messageAll('',"<color:FFFF00>"@%killer.name@"<color:FFFFFF> got the nuke!");
         if(isObject(%mini = %killer.miniGame))
            %mini.reset(%mini.owner);
      }
   }
};
activatePackage(Nuke);

--- End code ---


--- Quote from: Changes ---
* Fixed the fact that RTB pref registration should not contain a $ in the variable name.
* Now saves the variable even though you restart the server.
--- End quote ---


Pages: << < (2/4) > >>

Go to full version