Not a bad start. There is a bracket missing at the very end of the code, but I suspect maybe you accidently cut that off when you pasted the code?
In terms of improving scripting style/optimizing the script I'd suggest looking into switch statements maybe to avoid using so many if statements for checking the chat.
ie.
PHP Code:
if (player.chat == cmd) {
switch (cmd) {
case "start": {
//stuff that happens when the player says start here.
break;
}
case "/in": {
//stuff for 'in' here
break;
}
}
}
And also when you check the player's x and y for starting the spar the way you have done it is okay, but it would be better to have done:
PHP Code:
if (player.x in |12,52| && player.y in |13,41|) {
//stuff here
}