Menu Selector

Started by ShaKur, Apr 18, 2020, 08:12 PM

Previous topic - Next topic

ShaKur

Can I create a menu selector after the player registers or logs in?

How can I create and what should I use to do it?

Thanks
Sorry for my bad English

habi

#1
Dominio,, GUI s are scripted separately ( it's called client side scripting).
https://forum.vc-mp.org/?topic=4585

ShaKur

@habi You are not understanding me very well, I do not need a GUi editor to create almost non-functional scripts, what I need to know is how to get a background image that covers the entire screen, this image is a type of "mode selector menu "I mean that it contains the menus and I have to choose a game mode, now if ... How can I do that?

Thank you
Sorry for my bad English

habi

Domino, i am not good at client side menus, labels, buttons. But still i am confused.   Are you trying to create something like this.

Sebastian

Quote from: Dominio on Apr 20, 2020, 01:57 AM@habi You are not understanding me very well

Maybe if you were trying to elaborate it more from the beggining,  like you did in the last reply,  he would've understand it.  :-X

As for your question,  your best shot are buttons.
So this is what I would do: create a sprite,  with pos VectorScreen( 0, 0),  setting the size of the resolution of player.  (You can get that by some function I don't remember now)
Then create 2-3 buttons (asccording to your needs)  which you name:
1. Deathmatch
2. Racing
3. Drifting

Then you use the event that is called when player clicks on a button,  to send data from client to server,  and actually do something: teleporting player,  give him weps/cars etc.

There are examples of gui s around the forum,  so you have no excuse to not try it by yourself.
Then,  when you face errors you can ask for help.

ShaKur

Quote from: habi on Apr 20, 2020, 05:04 AMDomino, i am not good at client side menus, labels, buttons. But still i am confused.   Are you trying to create something like this.


exactly i mean something like this
Sorry for my bad English

ShaKur

Quote from: Sebastian on Apr 20, 2020, 07:04 AM
Quote from: Dominio on Apr 20, 2020, 01:57 AM@habi You are not understanding me very well

Maybe if you were trying to elaborate it more from the beggining,  like you did in the last reply,  he would've understand it.  :-X

As for your question,  your best shot are buttons.
So this is what I would do: create a sprite,  with pos VectorScreen( 0, 0),  setting the size of the resolution of player.  (You can get that by some function I don't remember now)
Then create 2-3 buttons (asccording to your needs)  which you name:
1. Deathmatch
2. Racing
3. Drifting

Then you use the event that is called when player clicks on a button,  to send data from client to server,  and actually do something: teleporting player,  give him weps/cars etc.

There are examples of gui s around the forum,  so you have no excuse to not try it by yourself.
Then,  when you face errors you can ask for help.

thanks, one last question regarding this, should i have any other .nut that is the game mode? for example rpg.nut, dm.nut, drifting.nut [/ code]
Sorry for my bad English

Sebastian

Quote from: Dominio on Apr 20, 2020, 09:05 PMthanks, one last question regarding this, should i have any other .nut that is the game mode? for example rpg.nut, dm.nut, drifting.nut [/ code]

It is not a requirment to have your script splitted in more .nut files.
Server loads only one .nut file, then, if you want, execute more files from that one, using commands like dofile( location and file name.nut ).
(example: dofile( "scripts/drifting.nut") )

DizzasTeR

Do note that you can't have vcmp events defined in multiple files, that won't work, if dm.nut has onPlayerJoin, then it won't work if you have it in rpg.nut as well or any other file

ShaKur

So what should I do to make the game modes work correctly? (Without repeating the functions or events in each .nut)

Sorry for my bad English

habi

deathmatch.nut
roleplay.nut
drifting.nut
........
if gamemode==deathmatch
   dofile deathmatch.nut

if gamemode==roleplay
   dofile roleplay.nut

......

ShaKur

Thanks.

PD: You've Discord?
Sorry for my bad English

habi

#12
Quote from: Dominio on May 08, 2020, 11:30 PMThanks.

PD: You've Discord?
I'll PM you