=FAS=Shigawire Posted October 1, 2008 Share Posted October 1, 2008 Hi Comm, You can call me stupid or everything else, I want to mae a new gamemode for MTA: Counter Strike. Now i learned basic scripting with lua, many things i can copy from Stealth, but i still need help. We need: => a bomb => Buy Menu => new scoreboard ( i like that from FMJ, how did they do that?) => maps => idea of skin id for the terrorists. => Add something here => hostage rescue system. Bomb Model isnt hard to make, using 3dsMax Buy Menu: Yes, could be difficult, rebuilding a one looking like CSs' one Maps: Not difficult, needs much time hostages: creating Peds, only possible from DP3 onwards So 1. create a new team for the players, called hostage or 2. hope dp3 release isn't very far I go on holidays for a few days and make some plans Pls post also, if you think, a CS gamemode wouldnt make much sense. Then i won't spend weeks for a new gamemode Link to comment
robhol Posted October 1, 2008 Share Posted October 1, 2008 IMO making a CS gamemode for MTA is a bad idea. Reasons: a) CS is CS, if people want to play CS, they'll probably play CS. b) Even if you made all you could as good as CS, it would basically be a CS clone with 10% chance of damaging someone when you shoot. Who would want that? Link to comment
Gamesnert Posted October 1, 2008 Share Posted October 1, 2008 Dunno if it's a good idea. Although robhol does have a point, I don't totally agree. Since you seem to need to buy CS, and on MTA it'd be a good try-before-you-buy. Link to comment
robhol Posted October 1, 2008 Share Posted October 1, 2008 Dunno if it's a good idea. Although robhol does have a point, I don't totally agree. Since you seem to need to buy CS, and on MTA it'd be a good try-before-you-buy. No, it wouldn't, and the reason is the obvious difference in engines, graphics, weapons, and last, but DEFINITELY not least, the 40 million bugs MTA brings into the picture. Also, to play MTA you still need to buy GTA:SA. Link to comment
=FAS=Shigawire Posted October 1, 2008 Author Share Posted October 1, 2008 Hm, yes. You could be right But Stealth as the onliest FPS gamemode becomes boring TBH. Then, tell me another good idea for a gamemode Link to comment
Scarface Posted October 1, 2008 Share Posted October 1, 2008 IMO making a CS gamemode for MTA is a bad idea. Reasons: a) CS is CS, if people want to play CS, they'll probably play CS. b) Even if you made all you could as good as CS, it would basically be a CS clone with 10% chance of damaging someone when you shoot. Who would want that? Many gamemodes of MTA were not 100% original, one example is the stealth gamemode, and i dont see the point of not having one, so what maybe people cant play cs or dont like it and prefer playing sa. Hm,yes. You could be right But Stealth as the onliest FPS gamemode becomes boring TBH. Then, tell me another good idea for a gamemode I would say COD4 Link to comment
=FAS=Shigawire Posted October 1, 2008 Author Share Posted October 1, 2008 I don't know Call of Duty 4. I only have got CoD2 ^^ However, i started making CS, each day 2 hours. We will add CS to our gamemodes, then the users can choose between CS and Stealth Atm, i made the Spawn screen. Link to comment
Scarface Posted October 1, 2008 Share Posted October 1, 2008 I don't know Call of Duty 4. I only have got CoD2 ^^However, i started making CS, each day 2 hours. We will add CS to our gamemodes, then the users can choose between CS and Stealth Atm, i made the Spawn screen. Videos of COD4 always help anyway i have never played sc, i dont think its a good idea about using both gamemodes with votemanager, cause unfortunatly theres too many vote abusers Link to comment
=FAS=Shigawire Posted October 1, 2008 Author Share Posted October 1, 2008 Im Stuck at the button part showCursor( true ) --function spawnmenu () GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Image = {} GUIEditor_Window1 = guiCreateWindow(283,119,701,564,"SPAWN MENU",false) guiSetAlpha(GUIEditor_Window1,0.80000001192093) GUIEditor_Button1 = guiCreateButton(0.1084,0.1454,0.3295,0.0816,"Terrorist",true,GUIEditor_Window1) guiSetAlpha(GUIEditor_Button1,1) GUIEditor_Button2 = guiCreateButton(0.1084,0.4043,0.3295,0.0816,"Counter Terrorist",true,GUIEditor_Window1) guiSetAlpha(GUIEditor_Button2,1) GUIEditor_Button3 = guiCreateButton(0.1084,0.6773,0.3295,0.0816,"Hostage",true,GUIEditor_Window1) guiSetAlpha(GUIEditor_Button3,1) GUIEditor_Memo1 = guiCreateMemo(0.5007,0.0727,0.4693,0.8918,"\n\n\nTerrorist:\nPlace a bomb or prevent hostage extraction\n\n\n\n\n\n\n\n\n\nCounter Terrorist:\nDefuse the bomb, rescure all hostages or kill all Terrorists\n\n\n\n\n\n\n\n\nHostage:\nTry to escape, but notice:\nYou are injured and you only have 10% Health.",true,GUIEditor_Window1) guiSetAlpha(GUIEditor_Memo1,1) GUIEditor_Image2 = guiCreateStaticImage(0.5036,0.5071,0.465,0.1968,"images/ant.jpg",true,GUIEditor_Window1) guiSetAlpha(GUIEditor_Image2,1) GUIEditor_Image3 = guiCreateStaticImage(0.5021,0.7908,0.4665,0.1755,"images/host.jpg",true,GUIEditor_Window1) guiSetAlpha(GUIEditor_Image3,1) GUIEditor_Image4 = guiCreateStaticImage(0.5021,0.2234,0.4665,0.2199,"images/ter.jpg",true,GUIEditor_Window1) guiSetAlpha(GUIEditor_Image4,1) --end function wnd_close() guiSetVisible( GUIEditor_Window1, false ) showCursor( false ) end addEventHandler( "onClientGUIClick", GUIEditor_Button1, wnd_close ) --addEventHandler ("onClientPlayerJoin", getLocalPlayer(), spawnmenu ) --function spawnter () --triggerServerEvent ( "onClickTerSpawn", getLocalPlayer(), "" ) --end When pressing the button, nothing happens Debugscript: bad element pointer .. ffs Link to comment
50p Posted October 1, 2008 Share Posted October 1, 2008 I remember I had similar problem with gui functions when gui elements are not created in onClientResourceStart. In some recent topic somebody said that he had the same solution. Link to comment
=FAS=Shigawire Posted October 1, 2008 Author Share Posted October 1, 2008 But you made the welcome window, so it IS working.... but i can't figure out what i am doing wrong Link to comment
Mr.Hankey Posted October 1, 2008 Share Posted October 1, 2008 lol shigawire I had the same idea half a year ago but i never finished it It's basically just a not finished spawn gui (but spawning works), a list of skins and i also started the buy menu but it's well... not really good/finished i think^^ Here's the code. I hope you can find anything helpful in there Server: addEvent ("selectTeam", true) addEvent ("spawn", true) addEvent ("loadmapdata", true) addEvent ("weapon", true) function spawnplayer (player, x, y, z, team) if team == "t" then local rand = math.random (1, #getElementChildren (getElementByID ("terror")))-1 local point = getElementChild (getElementByID ("terror"), rand) local x, y, z, skin = tonumber(getElementData (point, "posX")), tonumber(getElementData (point, "posY")), tonumber(getElementData (point, "posZ")), tonumber (getElementData (point, "skin")) spawnPlayer (player, x, y, z, 0, skin) giveWeapon (player, 22, 50, true) giveWeapon (player, 4) fadeCamera (player, true) elseif team == "ct" then local rand = math.random (1, #getElementChildren (getElementByID ("cterror")))-1 local point = getElementChild (getElementByID ("cterror"), rand) local x, y, z, skin = tonumber(getElementData (point, "posX")), tonumber(getElementData (point, "posY")), tonumber(getElementData (point, "posZ")), tonumber (getElementData (point, "skin")) spawnPlayer (player, x, y, z, 0, skin) giveWeapon (player, 23, 50, true) giveWeapon (player, 4) fadeCamera (player, true) end end function setteam (player, team) if team == "t" then setPlayerTeam (player, terror) elseif team == "ct" then setPlayerTeam (player, cterror) end end function loadmap () spawnst = getElementsByType ("tspawn") spawnsct = getElementsByType ("ctspawn") triggerClientEvent ("loadmap", getRootElement()) end function startup () outputChatBox ("test") terror = createTeam ( "Terrorists", 255, 0, 0 ) cterror = createTeam ( "Counter-Terrorists", 0, 0, 255 ) end function givew (id, ammo) giveWeapon (source, id, 100) end addEventHandler ("weapon", getRootElement(), givew) addEventHandler ("loadmapdata", getRootElement(), loadmap) addEventHandler ("spawn", getRootElement(), spawnplayer) addEventHandler ("selectTeam", getRootElement(), setteam) addEventHandler ("onResourceStart", getResourceRootElement(getThisResource()), startup) Client: --terror skins: 179 47 30 250 116 --ct skins: 285 165 281 147 277 y = 0.1 yp = 0.1 ys = 0.1 ysmg = 0.1 yr = 0.1 posX=727.44934082031, posY=-2301.5224609375, posZ=107.96048736572 posX=727.09851074219, posY=-2320.9113769531, posZ=107.65113067627 posX=704.1123046875, posY=-2320.8400878906, posZ=107.65058135986 posX=705.43524169922, posY=-2302.0942382813, posZ=107.93019866943 ct_skins = { "1", "2", "3", "4", "5", } t_skins = { "1", "2", "3", "4", "5", } addEvent ("loadmap", true) function t_spawn () triggerServerEvent ("selectTeam", getRootElement(), getLocalPlayer(), "t") guiSetVisible (spawn_w, false) guiSetVisible (t_w, true) end function ct_spawn () triggerServerEvent ("selectTeam", getRootElement(), getLocalPlayer(), "ct") guiSetVisible (spawn_w, false) guiSetVisible (ct_w, true) end function spawnt () guiSetVisible (t_w, false) triggerServerEvent ("spawn", getRootElement(), getLocalPlayer(), x, y, z, "t") showCursor (false) end function spawnct () triggerServerEvent ("spawn", getRootElement(), getLocalPlayer(), x, y, z, "ct") guiSetVisible (ct_w, false) showCursor (false) end function spec_join () guiSetVisible (spawn_w, false) end function hover () if source == t_w or source == ct_w then cancelEvent() else outputChatBox (guiGetText (source)) end end function startup () --stuff bindKey ("b", "down", buyMenu) bindKey ("m", "down", spawnMenu) showCursor (true) --spawnGUI spawn_w = guiCreateWindow (0.2, 0.2, 0.6, 0.6, "Select your Team!", true) t_w = guiCreateWindow (0.25, 0.2, 0.5, 0.7, "Select your Skin!", true) ct_w = guiCreateWindow (0.25, 0.2, 0.5, 0.7, "Select your Skin!", true) guiWindowSetMovable ( spawn_w, false ) guiWindowSetSizable ( spawn_w, false ) guiWindowSetMovable ( t_w, false ) guiWindowSetSizable ( t_w, false ) guiWindowSetMovable ( ct_w, false ) guiWindowSetSizable ( ct_w, false ) local t_b = guiCreateButton (0, 0.1, 0.3, 0.1, "Terrorists", true, spawn_w) local ct_b = guiCreateButton (0, 0.3, 0.3, 0.1, "Counter-Terrorists", true, spawn_w) local spec_b = guiCreateButton (0, 0.8, 0.3, 0.1, "Spectator", true, spawn_w) local y = 0.1 for k,v in ipairs (t_skins) do local b = guiCreateButton (0, y, 0.4, 0.1, v, true, t_w) y = y + 0.15 addEventHandler ("onClientGUIClick", b, spawnt) addEventHandler ("onClientMouseEnter", b, hover) end local y = 0.1 for k,v in ipairs (ct_skins) do local b = guiCreateButton (0, y, 0.4, 0.1, v, true, ct_w) y = y + 0.15 addEventHandler ("onClientGUIClick", b, spawnct) addEventHandler ("onClientMouseEnter", b, hover) end guiSetVisible (spawn_w, true) guiSetVisible (t_w, false) guiSetVisible (ct_w, false) addEventHandler ( "onClientGUIClick", t_b, t_spawn) addEventHandler ( "onClientGUIClick", ct_b, ct_spawn) addEventHandler ( "onClientGUIClick", spec_b, spec_join) end function spawnMenu () guiSetVisible (spawn_w, true) showCursor (true) end function buyMenu () end function gri_click () guiCreateStaticImage ( 0.4, 0.1, 0.6, 0.9, v..".png", true, t_w) end addEvent ("loadmap", true) function buy () if source == dealge_b then triggerServerEvent ("weapon", getLocalPlayer(), 24) elseif source == shot_b then triggerServerEvent ("weapon", getLocalPlayer(), 25) elseif source == spaz_b then triggerServerEvent ("weapon", getLocalPlayer(), 27) elseif source == mac_b then triggerServerEvent ("weapon", getLocalPlayer(), 28) elseif source == tec_b then triggerServerEvent ("weapon", getLocalPlayer(), 32) elseif source == mp_b then triggerServerEvent ("weapon", getLocalPlayer(), 29) elseif source == ak_b then triggerServerEvent ("weapon", getLocalPlayer(), 30) elseif source == m4_b then triggerServerEvent ("weapon", getLocalPlayer(), 31) elseif source == awp_b then triggerServerEvent ("weapon", getLocalPlayer(), 34) end end function loadmap () --buyMenuGUI buy_w = guiCreateWindow (0.2, 0.1, 0.6, 0.8, "Buy Menu", true) local tabPanel = guiCreateTabPanel ( 0, 0.1, 1, 1, true, buy_w ) --guiSetVisible (buy_w, false) --local wl = getElementChildren (getElementByID("wl")) --outputDebugString (tostring (wl)) --[[for k, v in ipairs (wl) do local type = getElementData (v, "type") if type == Pistols then if buy_w_p ~= true then buy_w_p = guiCreateWindow (0.2, 0.1, 0.6, 0.8, "Pistols", true) end local name = getElementData (v, "name") local cost, ammo, model = getElementData (v, "cost"), getElementData (v, "ammo"), getElementData (v, "model") local b = guiCreateButton (yp, 0.1, 0.3, 0.1, name, buy_w_p, true) setElementData (b, "cost", cost) setElementData (b, "ammo", ammo) setElementData (b, "model", model) yp = yp + 0.15 end end]] buy_w_p = guiCreateTab ("Pistols", tabPanel) deagle_b = guiCreateButton (0.05, 0.1, 0.3, 0.075, "Desert Eagle", true, buy_w_p) addEventHandler ( "onClientGUIClick", deagle_b, buy ) buy_w_s = guiCreateTab ("Shotguns", tabPanel) shot_b = guiCreateButton (0.05, 0.1, 0.3, 0.075, "Mosberg 500", true, buy_w_s) spaz_b = guiCreateButton (0.05, 0.2, 0.3, 0.075, "S.P.A.Z-12", true, buy_w_s) buy_w_m = guiCreateTab ("SMG's", tabPanel) mac_b = guiCreateButton (0.05, 0.1, 0.3, 0.075, "Mac-10", true, buy_w_m) tec_b = guiCreateButton (0.05, 0.2, 0.3, 0.075, "Tec-9", true, buy_w_m) mp_b = guiCreateButton (0.05, 0.2, 0.3, 0.075, "MP-5", true, buy_w_m) buy_w_r = guiCreateTab ("Rifles", tabPanel) ak_b = guiCreateButton (0.05, 0.1, 0.3, 0.075, "AK-47", true, buy_w_r) m4_b = guiCreateButton (0.05, 0.1, 0.3, 0.075, "M4", true, buy_w_r) awp_b = guiCreateButton (0.05, 0.1, 0.3, 0.075, "AWP", true, buy_w_r) buy_w_e = guiCreateTab ("Equipment", tabPanel) end function pos () x, y, z = getElementPosition (getLocalPlayer()) outputDebugString ( "posX="..x.." posY="..y.." posZ="..z, 1 ) end addCommandHandler ("savepos", pos) addEventHandler ("loadmap", getRootElement(), loadmap) addEventHandler ("onClientResourceStart", getResourceRootElement(getThisResource()), startup) Please note that the whole "loadmap" event thingy is way to complicated as the mapmanager already has the right events for that ("onGamemodeMapStart") And the whole gamemode is acutally really inefficient as at that time for example I didn't knew that the spawnmanager exists and therefore i used own map elemnts that would have been needless and got the spawnpoint coordinates by using getElementData and so on^^ Link to comment
=FAS=Shigawire Posted October 1, 2008 Author Share Posted October 1, 2008 omg Hankey, You are my Hero Thanks a lot. Btw, nice Zombie gamemode ;=) Uhm, black screen but first i must find out why my spawn window doesnt work Edit: its working now... I go on holidays now, back on monday. Ah, and eXo: Keep up that good work (Zombie). Maybe you should set the health of the zombies lower ^^ and the red screen, maybe its a lil bit too red Link to comment
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