Author Topic: What's wrong here?  (Read 722 times)

Code: [Select]
function serverCmdRagequit(%client)
{
messageAll('', "\c7"@%client.clanPrefix@"\c3"@%client.name@"\c7"@%client.clanSuffix@" <color:FFFFFF>: this is goddamn impossible, SCREW THIS!");
}
{
%client.delete("You have ragequitted.");
}
{
messageAll('', "\c3"@client.name@" \c1Has ragequit!!");
}

I have tested it in-game, but after I add the last command (client has ragequitted) it stops working.

Yes, I get that's its a lame and pointless script, but we all have to start somewhere, right?
« Last Edit: March 29, 2010, 07:42:40 PM by Sebster 105 »

I see two possible problems, I'm not the best scripter but fixing these both should fix it.
Two extra sets of {}, you only need one after (%client) and one at the end.
You need a ; at the very end, after the }.

Code: [Select]
function serverCmdRagequit(%client)
{
messageAll('', "\c7"@%client.clanPrefix@"\c3"@%client.name@"\c7"@%client.clanSuffix@" <color:FFFFFF>: this is goddamn impossible, SCREW THIS!");
%client.delete("You have ragequitted.");
messageAll('', "\c3"@client.name@" \c1Has ragequit!!");
}
« Last Edit: March 29, 2010, 09:04:56 PM by Orthone »

You need a ; at the very end, after the }.
You only need to end a bracket with a semicolon if you're creating an object such as a projectile or datablock.

You need a ; at the very end, after the }.
Only at the end of datablocks, packages, and the like.

You only need to end a bracket with a semicolon if you're creating an object such as a projectile or datablock.
Only at the end of datablocks, packages, and the like.
Alright, thanks for fixing my mistake.

Code: [Select]
function serverCmdRagequit(%client)
{
messageAll('', "\c7"@%client.clanPrefix@"\c3"@%client.name@"\c7"@%client.clanSuffix@" <color:FFFFFF>: this is goddamn impossible, SCREW THIS!");
%client.delete("You have ragequitted.");
messageAll('', "\c3"@client.name@" \c1Has ragequit!!");
}
Doing what is displayed here seems to crash the server.

Are you the one doing it? If you're hosting then it's obviously going to crash the server.

Are you the one doing it? If you're hosting then it's obviously going to crash the server.
In a dedi.
I'm not that stupid.

It turns out I was missing );'s from the last 2 commands, testing now.

Works, now the issue is for "name has ragequit"
it just says " has ragequit"

Was missing a % lol


God I suck at this.
« Last Edit: March 30, 2010, 11:05:32 AM by Sebster 105 »

You have to either display the message before the client leaves or store the name variable, otherwise it will be blank because there would be no object %client to retrieve the name variable from.

You have to either display the message before the client leaves or store the name variable, otherwise it will be blank because there would be no object %client to retrieve the name variable from.
Ohh. Explains alot.