Blockland Forums > Modification Help
Call of Duty Mod NEED HELP!
::Matt:::
Hey everyone, I have 2 questions.
First off I wanted to make a Call of Duty sort of mod. I made it so if you killed someone, in the center of your screen it says +50. Well, that didn't work.
Also for my 2nd questions, I was wondering what the coding was for resetting a mini-game. You can find my most likely failed attempt at it at line 93.
--- Code: ---package Cod
{
function gameConnection::onDeath(%client, %killerPlayer, %killer, %damageType, %a)
{
Parent::onDeath(%client, %killerPlayer, %killer, %damageType, %a);
if(1 == 1)
{
if(%client.kills >= 1)
{
centerPrint(%client, "<color:FFFFFF>+<color:00FF00>50", 2);
}
%client.kills=0;
%killer.kills++;
if(%killer.kills == 2)
{
centerPrint(%client, "<color:FFFFFF>+<color:00FF00>50", 2);
}
else if(%killer.kills == 3)
{
centerPrint(%client, "<color:FFFFFF>+<color:00FF00>50", 2);
}
else if(%killer.kills == 4)
{
centerPrint(%client, "<color:FFFFFF>+<color:00FF00>50", 2);
}
else if(%killer.kills == 5)
{
centerPrint(%client, "<color:FFFFFF>+<color:00FF00>50", 2);
}
else if(%killer.kills == 6)
{
centerPrint(%client, "<color:FFFFFF>+<color:00FF00>50", 2);
}
else if(%killer.kills == 7)
{
centerPrint(%client, "<color:FFFFFF>+<color:00FF00>50", 2);
}
else if(%killer.kills == 8)
{
centerPrint(%client, "<color:FFFFFF>+<color:00FF00>50", 2);
}
else if(%killer.kills == 9)
{
centerPrint(%client, "<color:FFFFFF>+<color:00FF00>50", 2);
}
else if(%killer.kills == 10)
{
centerPrint(%client, "<color:FFFFFF>+<color:00FF00>50", 2);
}
else if(%killer.kills == 11)
{
centerPrint(%client, "<color:FFFFFF>+<color:00FF00>50", 2);
}
else if(%killer.kills == 12)
{
centerPrint(%client, "<color:FFFFFF>+<color:00FF00>50", 2);
}
else if(%killer.kills == 13)
{
centerPrint(%client, "<color:FFFFFF>+<color:00FF00>50", 2);
}
else if(%killer.kills == 14)
{
centerPrint(%client, "<color:FFFFFF>+<color:00FF00>50", 2);
}
else if(%killer.kills == 15)
{
centerPrint(%client, "<color:FFFFFF>+<color:00FF00>50", 2);
}
else if(%killer.kills == 16)
{
centerPrint(%client, "<color:FFFFFF>+<color:00FF00>50", 2);
}
else if(%killer.kills == 17)
{
centerPrint(%client, "<color:FFFFFF>+<color:00FF00>50", 2);
}
else if(%killer.kills == 18)
{
centerPrint(%client, "<color:FFFFFF>+<color:00FF00>50", 2);
}
else if(%killer.kills >= 19)
{
centerPrint(%client, "<color:FFFFFF>+<color:00FF00>50", 2);
}
else if(%killer.kills >= 20)
{
messageAll('',"<color:FFFF00>"@%killer.name@"<color:FFFFFF> got the nuke!");
}
else if(%killer.kills >= 20)
{
resetMinigame;
}
activatePackage(Cod);
--- End code ---
::Matt:::
Wait a second... is HTML compatible with Torque? o_O
Bauklotz:
--- Code: ---package Cod {
function gameConnection::onDeath(%client, %killerPlayer, %killer, %damageType, %a) {
Parent::onDeath(%client, %killerPlayer, %killer, %damageType, %a);
%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(Cod);
--- End code ---
::Matt:::
So with RTB Preferences to enable/disable it, it would be...
--- Code: ---RTB_registerPref("Enable Nuke Script", "Nuke Script", "$ScriptNuke::Enable/Disable", "bool", "Script_Nuke", false, true, false, "");
package Nuke {
function gameConnection::onDeath(%client, %killerPlayer, %killer, %damageType, %a) {
Parent::onDeath(%client, %killerPlayer, %killer, %damageType, %a);
%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 ---
Amade:
--- Quote from: ::Matt:: on January 28, 2011, 09:30:42 AM ---Wait a second... is HTML compatible with Torque? o_O
--- End quote ---
Torque uses TorqueML which is actually fairly different, although it bears similarities to HTML.