Error in checking cmd level

Started by imran, Jun 26, 2015, 12:42 PM

Previous topic - Next topic

imran

I am getting error when i use admin cmds
I am using this:
local Level = GetLevel(player);
        if ( Level )
          {
if ( pinfo[ player.ID ].Level > 4 ) MessagePlayer("[#FF0000]Error: [#F7FE2E]You dont have Access to it.", player );
link

Diego^

#1
Remove:
local Level = GetLevel(player);
        if ( Level )
          {

When you use ">", you will be checking the level greater than 4. I think you should substitute "<", which checks if the player has less than 4 level.

In the case looks like this:
if ( pinfo[ player.ID ].Level < 4 ) MessagePlayer("[#FF0000]Error: [#F7FE2E]You dont have Access to it.", player );
BRL's Developer.

.

Can you please show the rest of the error output. Maybe we're missing something.

EDIT:

@Diego^ That doesn't even make sense :-\
.

Diego^

@S.L.C fact, looked at the print now ... In any case a fault has been corrected. :P
BRL's Developer.

imran

After correction of "<" again showing error
link

.

Quote from: imran on Jun 26, 2015, 03:43 PMAfter correction of "<" again showing error

Didn't I told you that? '>' or '<' it's still a comparison.
.

imran


Thijn

Remove your try catch block around the onPlayerCommand and give the full stacktrace.

imran


Murdock

Quote from: imran on Jun 26, 2015, 07:24 PMcant understand :'( disappointed

Maybe that's why you should learn proper programming first

imran


DizzasTeR

Quote from: imran on Jun 27, 2015, 09:10 AMProblem solved by myself :)

I have already cleared out this stupidity but alot of users still fall into the traps of these guys, these guys have no errors, they are just posting random codes and say its not working, and after alot of stupid posts which makes no sense and get to nowhere they get up, come here and type problem solved and then lock the topic. What does that accomplish?

imran