After adding a script that changes a brick/players colors to the paint can colors when the Paintinator hits, i can't switch off it after highlight another weapon until i fire it again :(
Edit: Console error found, i think i found one problem, so i'll be removing the line with the ##'s
Executing Add-Ons/Weapon_Paintinator/server.cs.
Add-Ons/Weapon_Paintinator/server.cs Line: 365 - Syntax error.
>>> Some error context, with ## on sides of error halt:
%skin = 'Yellow';
}
//%skin = 'Yellow';
%col.normcolor = %col.GetSkinName();
%col.setskinname(%skin);
%col.recolor = schedule(7500,0,"Recolor2",%col);
//Doesn't work. This is a backup of some stuff I already made a while ago...made for vehicle coloring##
>>> Error report complete.
Warning: DamageType "Paintinator" already exists.
function PaintinatorImage::onFire(%this,%obj,%slot)
{
if(%obj.getDamagePercent() < 1.0)
%obj.playThread(2, shiftAway);
Parent::onFire(%this,%obj,%slot);
}
function PaintinatorProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
%rand1 = getRandom(0,100);
%rand1 = "0." @ %rand1;
%rand2 = getRandom(0,100);
%rand2 = "0." @ %rand2;
%rand3 = getRandom(0,100);
%rand3 = "0." @ %rand3;
%rand4 = getRandom(0,100);
%rand4 = "0." @ %rand4;
%rand4 = 1;
//%randcolor = %rand1 SPC %rand2 SPC %rand3 SPC %rand4; //This sets the color to paint a random color.
%randcolor = getColorIDTable(%obj.client.currentColor); //This sets the color to the players color.
if(%col.getclassname () $= "Player" || %col.getclassname () $= "AIPlayer"){
if(!MiniGameCanDamage(%obj, %col)){
echo("Cant dmg");
return;
}
%col.setTempColor(%randcolor,30000);
Parent::onCollision(%this,%obj,%col,%fade,%pos,%normal);
}
if(%col.getclassname() $= "fxDTSBrick"){
if(%col.normcolor $= ""){
%col.normcolor = %col.getcolorID();
%col.recolor = schedule(7000,0,"Recolor",%col);
}
//%rand5 = getRandom(0,40); //Picks a random color.
%rand5 = %obj.client.currentColor; //Sets to paintcan color.
%col.setcolor(%rand5);
}
if(%col.getclassname() $= "WheeledVehicle" || %col.getclassname() $= "FlyingVehicle"){
if(!MiniGameCanDamage(%obj, %col)){
echo("Cant dmg");
return;
}
//echo("Hit a vehicle");
//To be filled in.
}
}
function Recolor(%obj)
{
%obj.setcolor(%obj.normcolor);
%obj.normcolor = "";
}
function Backup()
{
return;
%randskin = getRandom(0,6);
if(%randskin = 0)
{
%skin = "white";
}
if(%randskin = 1)
{
%skin = "Red";
}
if(%randskin = 2)
{
%skin = "Orange";
}
if(%randskin = 3)
{
%skin = "Blue";
}
if(%randskin = 4)
{
%skin = "Black";
}
if(%randskin = 5)
{
%skin = "Green";
}
if(%randskin = 6)
{
%skin = 'Yellow';
}
//%skin = 'Yellow';
%col.normcolor = %col.GetSkinName();
%col.setskinname(%skin);
%col.recolor = schedule(7500,0,"Recolor2",%col);
//Doesn't work. This is a backup of some stuff I already made a while ago...made for vehicle coloring. :|
}