Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[EO] Job Can Open Form


semlemsushi
 Share

Recommended Posts

what do you mean by picking a job. maybe he didnt understand what i said, i said that i need a code so that only a gundealer can view a certain button, and i added the Job As Byte and the other thing he said, then put the code in form_load and nongundealers can still see the button =P
Link to comment
Share on other sites

@Ertzel:

> Yes I understand what u r trying to do, but how do you even set somebody to be a gundealer?
>
> If you dont have the job set, then obv this wont work…

If _JOB_GUNDEALER As Byte = 0_ and all characters were not deleted then maybe their job has been set to 0: which means they are default Gundealer. set JOB_GUNDEALER to 1 and set a default job to 0 and see if that works.
Link to comment
Share on other sites

@Lightning:

> @Ertzel:
>
> > Yes I understand what u r trying to do, but how do you even set somebody to be a gundealer?
> >
> > If you dont have the job set, then obv this wont work…
>
> If _JOB_GUNDEALER As Byte = 0_ and all characters were not deleted then maybe their job has been set to 0: which means they are default Gundealer. set JOB_GUNDEALER to 1 and set a default job to 0 and see if that works.

I dont think I know what you're talking about. This is what it looks like in the server's and client's modConstants:
```
'Job Constants
Public Const JOB_GUNDEALER As Byte = 1
Public Const JOB_BODYGUARD As Byte = 2
```_JOB_GUNDEALER_ isn't set to 0, it's set to 1\. And the character didn't get deleted. Soo am I doing what your saying or what should I do?
Link to comment
Share on other sites

Make a new character Beforehand, make sure in the character creation and character loading code that the job has been set too, otherwise of course it will not work. :) So all you need to do is find the code (server side) that writes all of the character data to a file, and write its data at the end of that file.
Link to comment
Share on other sites

@semlemsushi:

> I dont think I know what you're talking about. This is what it looks like in the server's and client's modConstants:

You need a way to make someone a certain job. Without making someone have a job, then obv this wont work because no one will be a gundealer to see the button…
Link to comment
Share on other sites

@Ertzel:

> @semlemsushi:
>
> > I dont think I know what you're talking about. This is what it looks like in the server's and client's modConstants:
>
> You need a way to make someone a certain job. Without making someone have a job, then obv this wont work because no one will be a gundealer to see the button…

Or as a test you could put
```
Player(Index).Job = JOB_GUNDEALER
```in the character load. Then to test set the players' job to the default afterwards.
Link to comment
Share on other sites

All you need to do is replace this:
```
If Player(Index).Job = JOB_GUNDEALER Then
    btnGunDealer.Visible = True
End If
```
With this:
```
If Player(Index).Job = JOB_GUNDEALER Then
    btnGunDealer.Visible = True
ElseIf Player(Index).Job <> JOB_GUNDEALER Then
    btnGunDealer.Visible = False
End If
```
It's not difficult, only an elseif. And no, the GUNDEALER = 1 is just assigning GUNDEALER the value of 1, there is no need for a _.ini_.
Link to comment
Share on other sites

To set a job with these edits, do:
```
Player(MyIndex).Job = #
```Replacing # with whatever you want to set it to.

```
If Player(Index).Job = JOB_GUNDEALER Then
    btnGunDealer.Visible = True
ElseIf Player(Index).Job <> JOB_GUNDEALER Then
    btnGunDealer.Visible = False
End If
```The above may, or may not need Index replaced with MyIndex, also Player(MyIndex).Job _might_ need to have Index, rather than MyIndex, but I'm pretty sure all client-sided stuff uses MyIndex, and server sided is Index.

Also, to test what it thinks your job is, make a new label somewhere visible on frmMainGame, and name it "lblJob". Now in frmMainGame```
Private Sub Form_Load
```add:
```
lblJob.Caption = CStr(Player(MyIndex).Job)]/code]

If lblJob returns the wrong number, something is definitely screwing up.
~Urame
```
Link to comment
Share on other sites

@Urame:

> To set a job with these edits, do:
> ```
> Player(MyIndex).Job = #
> ```Replacing # with whatever you want to set it to.
>
> ```
> If Player(Index).Job = JOB_GUNDEALER Then
>     btnGunDealer.Visible = True
> ElseIf Player(Index).Job <> JOB_GUNDEALER Then
>     btnGunDealer.Visible = False
> End If
> ```The above may, or may not need Index replaced with MyIndex, also Player(MyIndex).Job _might_ need to have Index, rather than MyIndex, but I'm pretty sure all client-sided stuff uses MyIndex, and server sided is Index.
>
> Also, to test what it thinks your job is, make a new label somewhere visible on frmMainGame, and name it "lblJob". Now in frmMainGame```
> Private Sub Form_Load
> ```add:
> ```
> lblJob.Caption = CStr(Player(MyIndex).Job)]/code]
>
> If lblJob returns the wrong number, something is definitely screwing up.
> ~Urame
> ```

Thanks for compiling all my code, Urame (well most of it is mine). Should be easy enough to follow now.  XD

Regards,

Lightning
Link to comment
Share on other sites

Ok I did everything you said and nothings works. I have to change the "Index" to "MyIndex" for
```
If Player(Index).Job = JOB_GUNDEALER Then
    btnGunDealer.Visible = True
ElseIf Player(Index).Job <> JOB_GUNDEALER Then
    btnGunDealer.Visible = False
End If
```to make it possible to compile. Then, nothing shows up on the label. I also don't understand what you mean by

> To set a job with these edits, do:
> ```
> Player(MyIndex).Job = #
> ```

I'm thinking you have to set their job before they can see the button, but I'm totally lost, and extremely confused on how to do that.

I'm going to put up a link for my source code, and It would be cool if you could take quick peek at it, skim through the codes you need to look at and see what I'm adding/not adding/doing wrong, etc.

Link for Source Code: [http://www.mediafire.com/?62w6k16taahtwbb](http://www.mediafire.com/?62w6k16taahtwbb)

Thanks for bearing with me guys, I know I'm a noob at this shet, and also a pain in the ass but I hope I learn to develop like you guys through the journey of making my game  :cheesy:
Link to comment
Share on other sites

@â•‘Veneranceâ•‘:

> @semlemsushi:
>
> > Can anyone still help me with this 0.0
>
> I can try. When you say "job" are you looking to have seperate jobs from the starting classes? Or do you mean the jobs (aka classes) that you start the game with?

I mean the classes. I need it so that if you are a GunDealer (class 1 as it says in the classes.ini files i think) then a special button will show up. These guys are trying to help me but I stlil don't get it because i'm an ultra noob.
Link to comment
Share on other sites

@semlemsushi:

> @â•‘Veneranceâ•‘:
>
> > @semlemsushi:
> >
> > > Can anyone still help me with this 0.0
> >
> > I can try. When you say "job" are you looking to have seperate jobs from the starting classes? Or do you mean the jobs (aka classes) that you start the game with?
>
> I mean the classes. I need it so that if you are a GunDealer (class 1 as it says in the classes.ini files I think) then a special button will show up. These guys are trying to help me but I stlil don't get it because I'm an ultra noob.

Well in that case, it's more simple than you probably realize. Here, do this:

Add in form_load in the code for "frmMainGame":

If GetPlayerClass(Index) = (the number (ie. 1, 2, 3 etc for the gundealer class goes here)
  btnGundealer.visible = true
End If

Make the button named btnGundealer, and in its properties window make sure Visible is False.

Create a new char that isn't the class number, and the button shouldn't load.

Good luck!
Link to comment
Share on other sites

@semlemsushi:

> I can try. When you say "job" are you looking to have seperate jobs from the starting classes? Or do you mean the jobs (aka classes) that you start the game with?

I mean the classes. I need it so that if you are a GunDealer (class 1 as it says in the classes.ini files I think) then a special button will show up. These guys are trying to help me but I stlil don't get it because I'm an ultra noob.

OMG… dude then ur looking for a code to make something visible according to a CLASS not job. When u said job we all assumed u where talking about something new you had in your game where players have jobs, not classes so people gave u a code on how to add this new feature but its totally pointless cuz u don't need it at all if ur just using classes....
Link to comment
Share on other sites

@Ertzel:

> [quote author=semlemsushi link=topic=64468.msg693558#msg693558
> I can try. When you say "job" are you looking to have seperate jobs from the starting classes? Or do you mean the jobs (aka classes) that you start the game with?

I mean the classes. I need it so that if you are a GunDealer (class 1 as it says in the classes.ini files I think) then a special button will show up. These guys are trying to help me but I stlil don't get it because I'm an ultra noob.

OMG… dude then ur looking for a code to make something visible according to a CLASS not job. When u said job we all assumed u where talking about something new you had in your game where players have jobs, not classes so people gave u a code on how to add this new feature but its totally pointless cuz u don't need it at all if ur just using classes....

Damnit, I thought JOBS and CLASSES were the same thing, like in some other games like MapleStory. Oh well I'll just make a new thread then, someone close this please.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...