[QUESTION/HELP] DCMD Question
#24

Quote:
Originally Posted by JaTochNietDan
View Post
Well I recognize the strange syntax, I'm pretty sure I've seen you use it somewhere else before

I've seen you do this:

pawn Code:
if(something != something) SendClientMessage(playerid,color,"Error, can't do that");
{
    print("Can do that!"); // Really can't
}
Those brackets mean nothing, they aren't part of the if statement. This means that the code in them will always be run, even if the if statement is deemed true or false! Proper syntax would be either returning SendClientMessage to stop the rest of the code from running, or using a simple else statement. Like so:

Example #1:

pawn Code:
if(something != something) return SendClientMessage(playerid,color,"Error, can't do that");
print("Can do that!");
Example #2:

pawn Code:
if(something != something) SendClientMessage(playerid,color,"Error, can't do that");
else
{
    print("Can do that!");
}
I hope that helps you with avoiding future syntax problems
(Y)

You know what? You is AWESOME It helped a lot

And.. Thanks AGAIN! xD ahah :P
Reply


Messages In This Thread
[QUESTION/HELP] DCMD Question - by Larsey123IsMe - 18.01.2011, 14:07
Re: [QUESTION/HELP] DCMD Question - by Not available - 18.01.2011, 14:11
Re: [QUESTION/HELP] DCMD Question - by damiantof7 - 18.01.2011, 14:11
Re: [QUESTION/HELP] DCMD Question - by damiantof7 - 18.01.2011, 14:13
Re: [QUESTION/HELP] DCMD Question - by iggy1 - 18.01.2011, 14:13
Re: [QUESTION/HELP] DCMD Question - by xir - 18.01.2011, 14:15
Re: [QUESTION/HELP] DCMD Question - by Alex_Valde - 18.01.2011, 14:18
Re: [QUESTION/HELP] DCMD Question - by alpha500delta - 18.01.2011, 14:23
Re: [QUESTION/HELP] DCMD Question - by Larsey123IsMe - 18.01.2011, 14:36
Re: [QUESTION/HELP] DCMD Question - by Alex_Valde - 18.01.2011, 14:47
Re: [QUESTION/HELP] DCMD Question - by Larsey123IsMe - 18.01.2011, 15:03
Re: [QUESTION/HELP] DCMD Question - by alpha500delta - 18.01.2011, 15:07
Re: [QUESTION/HELP] DCMD Question - by Larsey123IsMe - 18.01.2011, 15:09
Re: [QUESTION/HELP] DCMD Question - by JaTochNietDan - 18.01.2011, 15:14
Re: [QUESTION/HELP] DCMD Question - by Larsey123IsMe - 18.01.2011, 15:27
Re: [QUESTION/HELP] DCMD Question - by Alex_Valde - 18.01.2011, 15:30
Re: [QUESTION/HELP] DCMD Question - by Larsey123IsMe - 18.01.2011, 15:33
Re: [QUESTION/HELP] DCMD Question - by Alex_Valde - 18.01.2011, 15:37
Re: [QUESTION/HELP] DCMD Question - by Larsey123IsMe - 18.01.2011, 15:47
Re: [QUESTION/HELP] DCMD Question - by JaTochNietDan - 18.01.2011, 15:49
Re: [QUESTION/HELP] DCMD Question - by Larsey123IsMe - 18.01.2011, 15:53
Re: [QUESTION/HELP] DCMD Question - by Alex_Valde - 18.01.2011, 15:55
Re: [QUESTION/HELP] DCMD Question - by JaTochNietDan - 18.01.2011, 15:57
Re: [QUESTION/HELP] DCMD Question - by Larsey123IsMe - 18.01.2011, 16:30

Forum Jump:


Users browsing this thread: 9 Guest(s)