Tired of GMs crashing the server because they forgot to add a parameter? To prevent this, use this simple check.
I've used this successfully with summon, item, job & level, and I'm sure it can be added to other commands too.
Don't ask me for support, because if you can't figure this out with the steps below, you shouldn't be bothering to make changes yourself. Wait for a repack with this implemented. This is not anti-leech. I'm just anti-stupid.
Repeat steps 1-3 as many times necessary, e.g., if you want level, job, summon & item fixed, repeat 4 times.
STEP 1
In players.cpp, look for:
where xxxx = item, job, level or summon
STEP 2
and underneath it, add:
STEP 3
and at the bottom of each command, right before the next
add
to close off the else statement started in step 2.
I've used this successfully with summon, item, job & level, and I'm sure it can be added to other commands too.
Don't ask me for support, because if you can't figure this out with the steps below, you shouldn't be bothering to make changes yourself. Wait for a repack with this implemented. This is not anti-leech. I'm just anti-stupid.
Repeat steps 1-3 as many times necessary, e.g., if you want level, job, summon & item fixed, repeat 4 times.
STEP 1
In players.cpp, look for:
Code:
else if(strcmp(command, "[B][U]xxxx[/U][/B]") == 0){
where xxxx = item, job, level or summon
STEP 2
and underneath it, add:
Code:
if(strlen(next_token) == 0){
PlayersPacket::ShowNotice(player, "Enter valid parameter.", 1);
}
else
{
STEP 3
and at the bottom of each command, right before the next
Code:
else if (command, "xxxxx" == 0 )
add
Code:
}
to close off the else statement started in step 2.
Last edited: