Jump to content

[REL/BETA] MTA: Modern Warfare - Build 10400


Bilal135

Recommended Posts

MTA: Modern Warfare was a project developed by Techray Development, but due to lack of time and developers' inactivity, the project was postponed. (Active once again, as of, 3/1/16)

Releasing the whole source code was a big decision, and so we expect some talented developer to continue and make this project more successful.

This game mode is based on default graphical user interface. The code might contain some serious bugs, that need to be fixed before it can run properly, as this is only the BETA version. The original fixed code was lost by the company due to hardware failures of the specific PC which contained the files.

Feature's Highlight:

The game mode consists of a login panel, a local play, team selector, class selector, gear selector, in game settings with various options and flexibility. This version of gamemode consists of 1 map, with spawn points for each team, and many more minor features.

(( More maps can be added by a few adaptations to the current code ))

Installation:

To install the game mode, simply extract the specified files in the ZIP to MTA'sDirectory/mods/deathmatch/resources.

Resources: https://community.multitheftauto.com/index.php?p= ... s&id=12163

Custom modifications: https://www.mediafire.com/?3sqbee95e78kdqf

For more information, visit the project's actual topic, viewtopic.php?f=115&t=90684

Any further updates to the code are not expected. Have a nice day.

Edited by Guest
Link to comment

What's the point of releasing anything with 'serious bugs' ? and if it was "fixed" before, why didn't you fix it again and uploaded the fixed version? (answer: hardware failure thing is bullshit)

Not to mention that code is not organised at all (except the parts of code which you copy-pasted from somewhere) and there are a lot of better and more optimised ways to do the code which you've uploaded here.

For example, wtf is this?

function onGuiClick() 
if ( source == dx_button1 ) then 
removeEventHandler("onClientRender", root, dx) 
guiSetVisible(dx_window, false) 
triggerEvent("teamSelector", localPlayer) 
end 
if ( source == yoi_button1 ) then 
guiSetVisible(yoi_window, false) 
showCursor(false) 
triggerServerEvent("setTeamUSA", localPlayer) 
triggerEvent("classUSA", localPlayer) 
end 
if ( source == yoi_button2 ) then 
guiSetVisible(yoi_window, false) 
showCursor(false) 
triggerServerEvent("setTeamRUS", localPlayer) 
triggerEvent("classRUS", localPlayer) 
end 
if ( source == button11 ) then 
triggerServerEvent("spawnUSA_class_assault", localPlayer) 
showCursor(true) 
guiSetVisible(window2, false) 
setElementData(localPlayer, "usa_assault", true) 
end 
if ( source == button22 ) then 
triggerServerEvent("spawnUSA_class_support", localPlayer) 
showCursor(true) 
guiSetVisible(window2, false) 
setElementData(localPlayer, "usa_support", true) 
end 
if ( source == button33 ) then 
triggerServerEvent("spawnUSA_class_recon", localPlayer) 
showCursor(true) 
guiSetVisible(window2, false) 
setElementData(localPlayer, "usa_recon", true) 
end 
if ( source == button1 ) then 
triggerServerEvent("spawnRUS_class_assault", localPlayer) 
showCursor(true) 
guiSetVisible(window, false) 
setElementData(localPlayer, "rus_assault", true) 
end 
if ( source == button2 ) then 
triggerServerEvent("spawnRUS_class_support", localPlayer) 
showCursor(true) 
guiSetVisible(window, false) 
setElementData(localPlayer, "rus_support", true) 
end 
if ( source == button3 ) then 
triggerServerEvent("spawnRUS_class_recon", localPlayer) 
showCursor(true) 
guiSetVisible(window, false) 
setElementData(localPlayer, "rus_recon", true) 
end 
if ( source == button111 ) then 
guiSetVisible(window3, false) 
setElementData(localPlayer, "m4", true) 
local team = getPlayerTeam(localPlayer) 
local usa = getTeamFromName("USA") 
local russia = getTeamFromName("Russia") 
if team == usa then 
triggerServerEvent("spawnUSA", localPlayer) 
showCursor(false) 
fadeCamera(true) 
setCameraTarget(localPlayer, localPlayer) 
elseif team == russia then 
triggerServerEvent("spawnRUS", localPlayer) 
showCursor(false) 
fadeCamera(true) 
setCameraTarget(localPlayer, localPlayer) 
end 
end 
if ( source == button222 ) then 
guiSetVisible(window3, false) 
setElementData(localPlayer, "ak47", true) 
local team = getPlayerTeam(localPlayer) 
local usa = getTeamFromName("USA") 
local russia = getTeamFromName("Russia") 
if team == usa then 
triggerServerEvent("spawnUSA", localPlayer) 
showCursor(false) 
fadeCamera(true) 
setCameraTarget(localPlayer, localPlayer) 
elseif team == russia then 
triggerServerEvent("spawnRUS", localPlayer) 
showCursor(false) 
fadeCamera(true) 
setCameraTarget(localPlayer, localPlayer) 
end 
end 
if ( source == button1111 ) then 
guiSetVisible(window4, false) 
setElementData(localPlayer, "mp5", true) 
local team = getPlayerTeam(localPlayer) 
local usa = getTeamFromName("USA") 
local russia = getTeamFromName("Russia") 
if team == usa then 
triggerServerEvent("spawnUSA", localPlayer) 
showCursor(false) 
fadeCamera(true) 
setCameraTarget(localPlayer, localPlayer) 
elseif team == russia then 
triggerServerEvent("spawnRUS", localPlayer) 
showCursor(false) 
fadeCamera(true) 
setCameraTarget(localPlayer, localPlayer) 
end 
end 
if ( source == button11111 ) then 
guiSetVisible(window5, false) 
setElementData(localPlayer, "sniper", true) 
local team = getPlayerTeam(localPlayer) 
local usa = getTeamFromName("USA") 
local russia = getTeamFromName("Russia") 
if team == usa then 
triggerServerEvent("spawnUSA", localPlayer) 
showCursor(false) 
fadeCamera(true) 
setCameraTarget(localPlayer, localPlayer) 
elseif team == russia then 
triggerServerEvent("spawnRUS", localPlayer) 
showCursor(false) 
fadeCamera(true) 
setCameraTarget(localPlayer, localPlayer) 
end 
end 
end 
addEventHandler("onClientGUIClick", root, onGuiClick) 

I am not writing this post as some hater, but rather telling you that if you want people to use your code or literally learn anything from it, you should make it look clean and optimised. And current state of it is like if you digged it from a trash can.

Link to comment
What's the point of releasing anything with 'serious bugs' ? and if it was "fixed" before, why didn't you fix it again and uploaded the fixed version? (answer: hardware failure thing is :~)

Not to mention that code is not organised at all (except the parts of code which you copy-pasted from somewhere) and there are a lot of better and more optimised ways to do the code which you've uploaded here.

For example, wtf is this?

function onGuiClick() 
if ( source == dx_button1 ) then 
removeEventHandler("onClientRender", root, dx) 
guiSetVisible(dx_window, false) 
triggerEvent("teamSelector", localPlayer) 
end 
if ( source == yoi_button1 ) then 
guiSetVisible(yoi_window, false) 
showCursor(false) 
triggerServerEvent("setTeamUSA", localPlayer) 
triggerEvent("classUSA", localPlayer) 
end 
if ( source == yoi_button2 ) then 
guiSetVisible(yoi_window, false) 
showCursor(false) 
triggerServerEvent("setTeamRUS", localPlayer) 
triggerEvent("classRUS", localPlayer) 
end 
if ( source == button11 ) then 
triggerServerEvent("spawnUSA_class_assault", localPlayer) 
showCursor(true) 
guiSetVisible(window2, false) 
setElementData(localPlayer, "usa_assault", true) 
end 
if ( source == button22 ) then 
triggerServerEvent("spawnUSA_class_support", localPlayer) 
showCursor(true) 
guiSetVisible(window2, false) 
setElementData(localPlayer, "usa_support", true) 
end 
if ( source == button33 ) then 
triggerServerEvent("spawnUSA_class_recon", localPlayer) 
showCursor(true) 
guiSetVisible(window2, false) 
setElementData(localPlayer, "usa_recon", true) 
end 
if ( source == button1 ) then 
triggerServerEvent("spawnRUS_class_assault", localPlayer) 
showCursor(true) 
guiSetVisible(window, false) 
setElementData(localPlayer, "rus_assault", true) 
end 
if ( source == button2 ) then 
triggerServerEvent("spawnRUS_class_support", localPlayer) 
showCursor(true) 
guiSetVisible(window, false) 
setElementData(localPlayer, "rus_support", true) 
end 
if ( source == button3 ) then 
triggerServerEvent("spawnRUS_class_recon", localPlayer) 
showCursor(true) 
guiSetVisible(window, false) 
setElementData(localPlayer, "rus_recon", true) 
end 
if ( source == button111 ) then 
guiSetVisible(window3, false) 
setElementData(localPlayer, "m4", true) 
local team = getPlayerTeam(localPlayer) 
local usa = getTeamFromName("USA") 
local russia = getTeamFromName("Russia") 
if team == usa then 
triggerServerEvent("spawnUSA", localPlayer) 
showCursor(false) 
fadeCamera(true) 
setCameraTarget(localPlayer, localPlayer) 
elseif team == russia then 
triggerServerEvent("spawnRUS", localPlayer) 
showCursor(false) 
fadeCamera(true) 
setCameraTarget(localPlayer, localPlayer) 
end 
end 
if ( source == button222 ) then 
guiSetVisible(window3, false) 
setElementData(localPlayer, "ak47", true) 
local team = getPlayerTeam(localPlayer) 
local usa = getTeamFromName("USA") 
local russia = getTeamFromName("Russia") 
if team == usa then 
triggerServerEvent("spawnUSA", localPlayer) 
showCursor(false) 
fadeCamera(true) 
setCameraTarget(localPlayer, localPlayer) 
elseif team == russia then 
triggerServerEvent("spawnRUS", localPlayer) 
showCursor(false) 
fadeCamera(true) 
setCameraTarget(localPlayer, localPlayer) 
end 
end 
if ( source == button1111 ) then 
guiSetVisible(window4, false) 
setElementData(localPlayer, "mp5", true) 
local team = getPlayerTeam(localPlayer) 
local usa = getTeamFromName("USA") 
local russia = getTeamFromName("Russia") 
if team == usa then 
triggerServerEvent("spawnUSA", localPlayer) 
showCursor(false) 
fadeCamera(true) 
setCameraTarget(localPlayer, localPlayer) 
elseif team == russia then 
triggerServerEvent("spawnRUS", localPlayer) 
showCursor(false) 
fadeCamera(true) 
setCameraTarget(localPlayer, localPlayer) 
end 
end 
if ( source == button11111 ) then 
guiSetVisible(window5, false) 
setElementData(localPlayer, "sniper", true) 
local team = getPlayerTeam(localPlayer) 
local usa = getTeamFromName("USA") 
local russia = getTeamFromName("Russia") 
if team == usa then 
triggerServerEvent("spawnUSA", localPlayer) 
showCursor(false) 
fadeCamera(true) 
setCameraTarget(localPlayer, localPlayer) 
elseif team == russia then 
triggerServerEvent("spawnRUS", localPlayer) 
showCursor(false) 
fadeCamera(true) 
setCameraTarget(localPlayer, localPlayer) 
end 
end 
end 
addEventHandler("onClientGUIClick", root, onGuiClick) 

The whole thing is linked with each other, and nothing from a trash can works, so take a chill pill. You never understood the code at first, and came here to bark at my code, drunk guy.

Link to comment
The whole thing is linked with each other, and nothing from a trash can works, so take a chill pill. You never understood the code at first, and came here to bark at my code, drunk guy.

All he said was that the code isn't organized, and he's right. Trying to read and figure out how the code is working when you're not even using indentation can be a pain.

It was just some criticism, no need to jump to name calling :P

The variable names for your buttons are nonsensical and just random names. You should try and keep it simple. For example if a button sets their team, name it something logical such as "buttonSetPlayerTeamUSA" instead of "yoi_button1".

Of course, people write differently, but if you're planning to release stuff you might want to look into cleaning it up a bit to avoid such criticism :)

Link to comment
The whole thing is linked with each other, and nothing from a trash can works, so take a chill pill. You never understood the code at first, and came here to bark at my code, drunk guy.

All he said was that the code isn't organized, and he's right. Trying to read and figure out how the code is working when you're not even using indentation can be a pain.

It was just some criticism, no need to jump to name calling :P

The variable names for your buttons are nonsensical and just random names. You should try and keep it simple. For example if a button sets their team, name it something logical such as "buttonSetPlayerTeamUSA" instead of "yoi_button1".

Of course, people write differently, but if you're planning to release stuff you might want to look into cleaning it up a bit to avoid such criticism :)

In fact, this was not supposed to be released, so I did it in my way. I don't have time to change variables, so for own convenience, anyone can change them, at last its not compiled.

Link to comment
In fact, this was not supposed to be released, so I did it in my way. I don't have time to change variables, so for own convenience, anyone can change them, at last its not compiled.

Don't get us wrong, just because we provide criticism doesn't mean we don't appreciate you releasing your work. I'm personally always glad to see people releasing their work - whether WIP or finished. There's always someone out there which will make some use of it in one way or another.

I wrote this tutorial a little while ago to try and help people organize their code structure properly. It might be something you'll find helpful.

Not only will keeping it clean help yourself, but also others should you decide to release it.

Link to comment

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...