Blockland Forums > Modification Help
Call of Duty Mod NEED HELP!
::Matt:::
--- Quote from: Bauklotz on February 02, 2011, 10:15:42 AM ---
--- 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 ---
--- End quote ---
Dude I must say, I really appreciate your help. But there is still 1 error that you might not have found.
The +50 message on line 12 displays to the player that is killed rather than the killer. I am pretty sure what I did, (change
--- Code: ---centerPrint(%client, "<color:FFFFFF>+<color:00FF00>50", 2);
--- End code ---
to
--- Code: ---centerPrint(%client.killer, "<color:FFFFFF>+<color:00FF00>50", 2);
--- End code ---
)
Tell me if I'm right I haven't had a chance to test it.
P.S. I tried centerPrint
--- Code: ---(%killer, "<color:FFFFFF>+<color:00FF00>50", 2);
--- End code ---
and
--- Code: ---centerPrint(%killerPlayer, "<color:FFFFFF>+<color:00FF00>50", 2);
--- End code ---
::Matt:::
Still need help.
MasterBlockMan:
Isn't that 50+ thing possible with events?
Red_Guy:
try:
--- Code: ---centerPrint(%killer.client, "<color:FFFFFF>+<color:00FF00>50", 2);
--- End code ---
also change:
if(%client $= %killer)
return;
to:
if(%client == %killer)
return;
$= is to compare strings, but %client is a number
and:
messageAll('',"<color:FFFF00>"@%killer.name@"<color:FFFFFF> got the nuke!");
to:
messageAll('',"<color:FFFF00>"@%killer.getPlayerName()@"<color:FFFFFF> got the nuke!");
in some cases %killer.name will not work. but getPlayerName() always works.
::Matt:::
--- Quote from: MasterBlockMan on February 03, 2011, 09:27:14 AM ---Isn't that 50+ thing possible with events?
--- End quote ---
Probably but that would require a lot of VCE/onPlayerTouch ifVariables and some people don't want to go through that.