Author Topic: Overall Coding Help Needed for My Project  (Read 3241 times)

Thanks for your useless response, but I was just telling him in case he didn't want a space in his future coding.
And that was a pointlessly aggressive response to a simple miscommunication.

Thanks for your useless response, but I was just telling him in case he didn't want a space in his future coding.

I was correcting RTBARCHIVE who stated he needed the @ instead of SPC
You need to have @ symbols when displaying a variable in any chat form.

I was correcting RTBARCHIVE who stated he needed the @ instead of SPC
Crown took it that way because you put it right after quoting him.

Okay, I have a semi-final script here. The problem is is that there is a syntax error around SPC on line 5. I am also wondering how to make the GUI refresh every second.

Edit: I also need to know how to edit zombies player type or items on each wave.

Code: [Select]
function Slayer_MinigameSO::onReset(%this)
{
%wave = 1;
commandToAll('centerPrint', "<font:impact:50><color:f420eb>The first wave has begun!",5);
commandToAll('bottomPrint', "<color:f420eb>Wave: <color:ffffff>" SPC %wave "<color:1818ba>You are a <color:FFFFFF>"SPC%client.getTeam().name) "<color:f420eb>Wave Time Remaining: <color:ffffff>" SPC %time;
%time = 240
serTimer2(%time, %wave, %client);

function serTimer2(%time, %wave, %client)
{
if (%time <= 0)
{
%wave = 2;
commandToAll('centerPrint', "<font:impact:50><color:f420eb>The second wave has begun!",5);
commandToAll('bottomPrint', "<color:f420eb>Wave: <color:ffffff>" SPC %wave "<color:1818ba>You are a <color:FFFFFF>" SPC %client.getTeam().name);
%time = 240
serTimer3(%time, %wave, %client);
}
}
else
{
%time--;

$TimerSchedule = schedule(1000, 0, "serTimer", %time);
}

function serTimer3(%time, %wave, %client)
{
if (%time <= 0)
{
%wave = 3;
commandToAll('centerPrint', "<font:impact:50><color:f420eb>The third wave has begun!",5);
commandToAll('bottomPrint', "<color:f420eb>Wave: <color:ffffff>" SPC %wave "<color:1818ba>You are a <color:FFFFFF>" SPC %client.getTeam().name);
%time = 240
serTimer4(%time, %wave, %client);
}
}
else
{
%time--;

$TimerSchedule = schedule(1000, 0, "serTimer", %time);
}

function serTimer4(%time, %wave, %client)
{
if (%time <= 0)
{
%wave = 4;
commandToAll('centerPrint', "<font:impact:50><color:f420eb>The forth wave has begun!",5);
commandToAll('bottomPrint', "<color:f420eb>Wave: <color:ffffff>" SPC %wave "<color:1818ba>You are a <color:FFFFFF>" SPC %client.getTeam().name);
%time = 240
serTimer5(%time, %wave, %client);
}
}
else
{
%time--;

$TimerSchedule = schedule(1000, 0, "serTimer", %time);
}

function serTimer5(%time, %wave, %client)
{
if (%time <= 0)
{
%wave = 5;
commandToAll('centerPrint', "<font:impact:50><color:f420eb>The fifth and final wave has begun!",5);
commandToAll('bottomPrint', "<color:f420eb>Wave: <color:ffffff>" SPC %wave "<color:1818ba>You are a <color:FFFFFF>" SPC %client.getTeam().name);
%time = 240
serTimer6(%time, %wave, %client);
}
}
else
{
%time--;

$TimerSchedule = schedule(1000, 0, "serTimer", %time);
}

function serTimer6(%time, %wave, %client)
{
if (%time <= 0)
{
%wave = 5;
commandToAll('centerPrint', "<font:impact:50><color:f420eb>The Survivors have Won!",5);
}
}
else
{
%time--;

$TimerSchedule = schedule(1000, 0, "serTimer", %time);
}
}
« Last Edit: February 09, 2015, 07:07:33 PM by rggbnnnnn »

You forgot to put SPC after %wave. You need to put sandwich your variables with the SPC.

okay so i put SPC on both sides of the var, I see.

Okay I edited the code a bit. It is not a fan of my ; at the end of line 5 for some reason:
Code: [Select]
function Slayer_MinigameSO::onReset(%this)
{
%wave = 1;
commandToAll('centerPrint', "<font:impact:50><color:f420eb>The first wave has begun!",5);
commandToAll('bottomPrint', "<color:f420eb>Wave: <color:ffffff>" SPC %wave SPC "<color:1818ba>You are a <color:FFFFFF>" SPC %client.getTeam().name) SPC "<color:f420eb>Wave Time Remaining: <color:ffffff>" %time);
%time = 240
serTimer2(%time, %wave, %client);

function serTimer2(%time, %wave, %client)
{
if (%time <= 0)
{
%wave = 2;
commandToAll('centerPrint', "<font:impact:50><color:f420eb>The second wave has begun!",5);
commandToAll('bottomPrint', "<color:f420eb>Wave: <color:ffffff>" SPC %wave SPC "<color:1818ba>You are a <color:FFFFFF>" SPC %client.getTeam().name) SPC "<color:f420eb>Wave Time Remaining: <color:ffffff>" %time);
%time = 240
serTimer3(%time, %wave, %client);
}
}
else
{
%time--;

$TimerSchedule = schedule(1000, 0, "serTimer", %time);
}

function serTimer3(%time, %wave, %client)
{
if (%time <= 0)
{
%wave = 3;
commandToAll('centerPrint', "<font:impact:50><color:f420eb>The third wave has begun!",5);
commandToAll('bottomPrint', "<color:f420eb>Wave: <color:ffffff>" SPC %wave SPC "<color:1818ba>You are a <color:FFFFFF>" SPC %client.getTeam().name) SPC "<color:f420eb>Wave Time Remaining: <color:ffffff>" %time);
%time = 240
serTimer4(%time, %wave, %client);
}
}
else
{
%time--;

$TimerSchedule = schedule(1000, 0, "serTimer", %time);
}

function serTimer4(%time, %wave, %client)
{
if (%time <= 0)
{
%wave = 4;
commandToAll('centerPrint', "<font:impact:50><color:f420eb>The forth wave has begun!",5);
commandToAll('bottomPrint', "<color:f420eb>Wave: <color:ffffff>" SPC %wave SPC "<color:1818ba>You are a <color:FFFFFF>" SPC %client.getTeam().name) SPC "<color:f420eb>Wave Time Remaining: <color:ffffff>" %time);
%time = 240
serTimer5(%time, %wave, %client);
}
}
else
{
%time--;

$TimerSchedule = schedule(1000, 0, "serTimer", %time);
}

function serTimer5(%time, %wave, %client)
{
if (%time <= 0)
{
%wave = 5;
commandToAll('centerPrint', "<font:impact:50><color:f420eb>The fifth and final wave has begun!",5);
commandToAll('bottomPrint', "<color:f420eb>Wave: <color:ffffff>" SPC %wave SPC "<color:1818ba>You are a <color:FFFFFF>" SPC %client.getTeam().name) SPC "<color:f420eb>Wave Time Remaining: <color:ffffff>" %time);
%time = 240
serTimer6(%time, %wave, %client);
}
}
else
{
%time--;

$TimerSchedule = schedule(1000, 0, "serTimer", %time);
}

function serTimer6(%time, %wave, %client)
{
if (%time <= 0)
{
%wave = 5;
commandToAll('centerPrint', "<font:impact:50><color:f420eb>The Survivors have Won!",5);
}
}
else
{
%time--;

$TimerSchedule = schedule(1000, 0, "serTimer", %time);
}
}

SPC %client.getTeam().name) SPC

There's an extra closing parenthesis.

"... Remaining: <color:ffffff>" %time);

There's nothing to join that string and %time.

SPC %client.getTeam().name) SPC

There's an extra closing parenthesis.

"... Remaining: <color:ffffff>" %time);

There's nothing to join that string and %time.
I put SPC between the string and %time and it still hates the ; at the end of the line.

I put SPC between the string and %time and it still hates the ; at the end of the line.

SPC %client.getTeam().name) SPC

There's an extra closing parenthesis.



These aren't causing it but are also errors (in the first function - there's plenty all over):

%time = 240
No ending ;

function Slayer_MinigameSO::onReset(%this)
This function is never closed by a }

nevermind port answered.

I fixed the time and the ; problem, but the function does have a finishing ; on line 95. Now it dislikes the " after ....SPC %client.getTeam().name); SPC on line 5
« Last Edit: February 09, 2015, 09:26:33 PM by rggbnnnnn »

This is getting quite frustrating. I have fixed so sintax errors and others are poping up. Now it does not like the" s" in my god dang function on line 9
Code: [Select]
function Slayer_MinigameSO::onReset(%this)
{
%wave = 1;
commandToAll('centerPrint', "<font:impact:50><color:f420eb>The first wave has begun!",5);
commandToAll('bottomPrint', "<color:f420eb>Wave: <color:ffffff>" SPC %wave SPC "<color:1818ba>You are a <color:FFFFFF>" SPC %client.getTeam().name SPC "<color:f420eb>Wave Time Remaining: <color:ffffff>" SPC %time);
%time = 240;
serTimer2(%time, %wave, %client);

function serTimer2(%time, %wave, %client)
{
if (%time <= 0)
{
%wave = 2;
commandToAll('centerPrint', "<font:impact:50><color:f420eb>The second wave has begun!",5);
commandToAll('bottomPrint', "<color:f420eb>Wave: <color:ffffff>" SPC %wave SPC "<color:1818ba>You are a <color:FFFFFF>" SPC %client.getTeam().name SPC "<color:f420eb>Wave Time Remaining: <color:ffffff>" SPC %time);
%time = 240;
serTimer3(%time, %wave, %client);
}
}
else
{
%time--;

$TimerSchedule = schedule(1000, 0, "serTimer", %time);
}

function serTimer3(%time, %wave, %client)
{
if (%time <= 0)
{
%wave = 3;
commandToAll('centerPrint', "<font:impact:50><color:f420eb>The third wave has begun!",5);
commandToAll('bottomPrint', "<color:f420eb>Wave: <color:ffffff>" SPC %wave SPC "<color:1818ba>You are a <color:FFFFFF>" SPC %client.getTeam().name SPC "<color:f420eb>Wave Time Remaining: <color:ffffff>" SPC %time);
%time = 240;
serTimer4(%time, %wave, %client);
}
}
else
{
%time--;

$TimerSchedule = schedule(1000, 0, "serTimer", %time);
}

function serTimer4(%time, %wave, %client)
{
if (%time <= 0)
{
%wave = 4;
commandToAll('centerPrint', "<font:impact:50><color:f420eb>The forth wave has begun!",5);
commandToAll('bottomPrint', "<color:f420eb>Wave: <color:ffffff>" SPC %wave SPC "<color:1818ba>You are a <color:FFFFFF>" SPC %client.getTeam().name SPC "<color:f420eb>Wave Time Remaining: <color:ffffff>" SPC %time);
%time = 240;
serTimer5(%time, %wave, %client);
}
}
else
{
%time--;

$TimerSchedule = schedule(1000, 0, "serTimer", %time);
}

function serTimer5(%time, %wave, %client)
{
if (%time <= 0)
{
%wave = 5;
commandToAll('centerPrint', "<font:impact:50><color:f420eb>The fifth and final wave has begun!",5);
commandToAll('bottomPrint', "<color:f420eb>Wave: <color:ffffff>" SPC %wave SPC "<color:1818ba>You are a <color:FFFFFF>" SPC %client.getTeam().name SPC "<color:f420eb>Wave Time Remaining: <color:ffffff>" SPC %time);
%time = 240;
serTimer6(%time, %wave, %client);
}
}
else
{
%time--;

$TimerSchedule = schedule(1000, 0, "serTimer", %time);
}

function serTimer6(%time, %wave, %client)
{
if (%time <= 0)
{
%wave = 5;
commandToAll('centerPrint', "<font:impact:50><color:f420eb>The Survivors have Won!",5);
}
}
else
{
%time--;

$TimerSchedule = schedule(1000, 0, "serTimer", %time);
}
}

This is getting quite frustrating. I have fixed so sintax errors and others are poping up. Now it does not like the" s" in my god dang function on line 9
Code: [Select]
function Slayer_MinigameSO::onReset(%this)
{
%wave = 1;
commandToAll('centerPrint', "<font:impact:50><color:f420eb>The first wave has begun!",5);
commandToAll('bottomPrint', "<color:f420eb>Wave: <color:ffffff>" SPC %wave SPC "<color:1818ba>You are a <color:FFFFFF>" SPC %client.getTeam().name SPC "<color:f420eb>Wave Time Remaining: <color:ffffff>" SPC %time);
%time = 240;
serTimer2(%time, %wave, %client);

function serTimer2(%time, %wave, %client)
{
if (%time <= 0)
{
%wave = 2;
commandToAll('centerPrint', "<font:impact:50><color:f420eb>The second wave has begun!",5);
commandToAll('bottomPrint', "<color:f420eb>Wave: <color:ffffff>" SPC %wave SPC "<color:1818ba>You are a <color:FFFFFF>" SPC %client.getTeam().name SPC "<color:f420eb>Wave Time Remaining: <color:ffffff>" SPC %time);
%time = 240;
serTimer3(%time, %wave, %client);
}
}
else
{
%time--;

$TimerSchedule = schedule(1000, 0, "serTimer", %time);
}

function serTimer3(%time, %wave, %client)
{
if (%time <= 0)
{
%wave = 3;
commandToAll('centerPrint', "<font:impact:50><color:f420eb>The third wave has begun!",5);
commandToAll('bottomPrint', "<color:f420eb>Wave: <color:ffffff>" SPC %wave SPC "<color:1818ba>You are a <color:FFFFFF>" SPC %client.getTeam().name SPC "<color:f420eb>Wave Time Remaining: <color:ffffff>" SPC %time);
%time = 240;
serTimer4(%time, %wave, %client);
}
}
else
{
%time--;

$TimerSchedule = schedule(1000, 0, "serTimer", %time);
}

function serTimer4(%time, %wave, %client)
{
if (%time <= 0)
{
%wave = 4;
commandToAll('centerPrint', "<font:impact:50><color:f420eb>The forth wave has begun!",5);
commandToAll('bottomPrint', "<color:f420eb>Wave: <color:ffffff>" SPC %wave SPC "<color:1818ba>You are a <color:FFFFFF>" SPC %client.getTeam().name SPC "<color:f420eb>Wave Time Remaining: <color:ffffff>" SPC %time);
%time = 240;
serTimer5(%time, %wave, %client);
}
}
else
{
%time--;

$TimerSchedule = schedule(1000, 0, "serTimer", %time);
}

function serTimer5(%time, %wave, %client)
{
if (%time <= 0)
{
%wave = 5;
commandToAll('centerPrint', "<font:impact:50><color:f420eb>The fifth and final wave has begun!",5);
commandToAll('bottomPrint', "<color:f420eb>Wave: <color:ffffff>" SPC %wave SPC "<color:1818ba>You are a <color:FFFFFF>" SPC %client.getTeam().name SPC "<color:f420eb>Wave Time Remaining: <color:ffffff>" SPC %time);
%time = 240;
serTimer6(%time, %wave, %client);
}
}
else
{
%time--;

$TimerSchedule = schedule(1000, 0, "serTimer", %time);
}

function serTimer6(%time, %wave, %client)
{
if (%time <= 0)
{
%wave = 5;
commandToAll('centerPrint', "<font:impact:50><color:f420eb>The Survivors have Won!",5);
}
}
else
{
%time--;

$TimerSchedule = schedule(1000, 0, "serTimer", %time);
}
}
When the console reports syntax errors it does not say exactly what or where it is. It just says the general area it's in.

Coding requires a lot of logic, but no matter how many times we tell you(and it's not helping that people keep spoon feeding you), you can't seem to grasp the concept of brackets. Every opening bracket needs a closing bracket. Every if statement with an opening bracket needs a closing brick. Every if/else statement needs to be inside of a function. Now fix them.

You'll also need to package and parent Slayer_MinigameSO::onReset to not break things.

-snip-
Okay.  I will stop asking for fixes to syntax.
I just need two more things:
I need to know how to parent/package
I need to know how to make team zombie change its player type or items via script.