cibu Posted July 28, 2022 Posted July 28, 2022 Hello! How can i get from mysql db the vehicles that are for the group 1? I wanna put them in the dialog (list). What i want to do is when the user uses [/sfv] to show me the vehicles for the group x. how can i do that? mp.events.addCommand('sfv', (player) => { if(player.data.playerGroup == -1) return sendMessage(player, '#32a852', `Eroare: !{#FFFFFF}Nu faci parte dintr-o factiune.`); showSFV(player, player.data.playerGroup); }); function showSFV(player, faction) { let list = []; player.selectoptions = []; let f = player.data.playerGroup; let text = `[SFV]: Faction #${f}`; for(let x = 0; x < 3; x++) { list.push(struct.sfv[x].vehID + ". " + struct.sfv[x].vehModel); player.selectoptions.push(x); } player.call(SERVER_EVENT.REQUEST_DIALOG, ["listItem", "sfv_dialog", text, "sfv dialog", list, ["Spawn", "Cancel"], ]); return 1; }
Skole Posted July 31, 2022 Posted July 31, 2022 Well, you would probably do something like SELECT * FROM cars WHERE faction = 1; And than with those results display them in dialog... All you need is knowledge of MySQL
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now