Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: imran on Jun 26, 2015, 12:42 PM

Title: Error in checking cmd level
Post by: imran on Jun 26, 2015, 12:42 PM
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 (http://s23.postimg.org/bnxam8fpn/Capture.png)
Title: Re: Error in checking cmd level
Post by: Diego^ on Jun 26, 2015, 12:55 PM
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 );
Title: Re: Error in checking cmd level
Post by: . on Jun 26, 2015, 12:55 PM
Can you please show the rest of the error output. Maybe we're missing something.

EDIT:

@Diego^ That doesn't even make sense :-\
Title: Re: Error in checking cmd level
Post by: Diego^ on Jun 26, 2015, 01:06 PM
@S.L.C fact, looked at the print now ... In any case a fault has been corrected. :P
Title: Re: Error in checking cmd level
Post by: imran on Jun 26, 2015, 03:43 PM
After correction of "<" again showing error
link (http://s8.postimg.org/iv6tnij51/Capture.png)
Title: Re: Error in checking cmd level
Post by: . on Jun 26, 2015, 03:55 PM
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.
Title: Re: Error in checking cmd level
Post by: imran on Jun 26, 2015, 04:00 PM
tell me how to fix this?????????? >.<
Title: Re: Error in checking cmd level
Post by: Thijn on Jun 26, 2015, 04:10 PM
Remove your try catch block around the onPlayerCommand and give the full stacktrace.
Title: Re: Error in checking cmd level
Post by: imran on Jun 26, 2015, 07:24 PM
cant understand :'( disappointed
Title: Re: Error in checking cmd level
Post by: Murdock on Jun 26, 2015, 07:25 PM
Quote from: imran on Jun 26, 2015, 07:24 PMcant understand :'( disappointed

Maybe that's why you should learn proper programming first
Title: Re: Error in checking cmd level
Post by: imran on Jun 27, 2015, 09:10 AM
Problem solved by myself :)
Title: Re: Error in checking cmd level
Post by: DizzasTeR on Jun 27, 2015, 09:33 AM
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?
Title: Re: Error in checking cmd level
Post by: imran on Jun 27, 2015, 10:17 AM
Doom I am not mad >.<