-
Posts
1,089 -
Joined
-
Last visited
Everything posted by Xwad
-
Thanks but i already made it
-
I made it and it works. Thanks!
-
I made it and it works. Thanks!
-
now the spawn scrpit is also not working ERROR? Server triggered clientside event showGUI, but event is not added toclientside
-
Hi what funcions need i use to make a script that makes a camera move from 1 point to other point?
-
Hi what funcions need i use to make a script that makes a camera move from 1 point to other point?
-
wtf its the same debug again!!why is it not working? WARNING: WW2/spawn/client.lua:98: Bad 'sound/player' pointer @ 'setSoundVolume'(1) this is the full script maybe i did something wrong:// CLIENT.LUA classWnd = guiCreateWindow(185, 129, 479, 407, "Spawn Panel", false) guiWindowSetSizable(classWnd, false) guiSetVisible(classWnd, false) spawnG = guiCreateGridList(5, 27, 167, 160, false, classWnd) guiGridListAddColumn(spawnG, "Allies", 0.9) skins = { {"M4 Sherman", 287}, {"M26 Pershing (not available)", 171}, } for i,skins in ipairs(skins) do row = guiGridListAddRow(spawnG) guiGridListSetItemText(spawnG, row, 1, tostring(skins[1]), false, false) guiGridListSetItemData(spawnG, row, 1, tostring(skins[2])) end guiGridListAddRow(spawnG) spawnbtn = guiCreateButton(35, 200, 102, 44, "To battle!", false, classWnd) desc = guiCreateMemo(10, 260, 459, 140, "Welcome to World of Tanks MTA server! Choose your team!", false, classWnd) guiMemoSetReadOnly(desc, true) guiCreateLabel(166, 242, 136, 13, "Spawn Panel By Shaman", false, classWnd) function joinAllies() if ( source == spawnbtn ) then local row, col = guiGridListGetSelectedItem( spawnG ) local name = guiGridListGetItemText( spawnG, row, col ) if name == "M4 Sherman" then local id = 287 triggerServerEvent("spawn_sherman", getLocalPlayer(), id) guiSetVisible(classWnd, false) showCursor(false) elseif name == "M26 Pershing" then local id = 171 triggerServerEvent("spawn_pershing", getLocalPlayer(), id) guiSetVisible(classWnd, false) showCursor(false) end end end addEventHandler("onClientGUIClick",root,joinAllies) addEventHandler("onClientGUIClick",root,joinSurvivor) spawnG2 = guiCreateGridList(302, 27, 167, 160, false, classWnd) guiGridListAddColumn(spawnG2, "Axis", 0.9) skins = { {"Tiger I Ausf E", 270}, {"King Tiger II (not available)", 127}, } for i,skins in ipairs(skins) do row = guiGridListAddRow(spawnG2) guiGridListSetItemText(spawnG2, row, 1, tostring(skins[1]), false, false) guiGridListSetItemData(spawnG2, row, 1, tostring(skins[2])) end guiGridListAddRow(spawnG2) spawnbtn2 = guiCreateButton(330, 200, 102, 44, "To battle!", false, classWnd) function joinAxis() if ( source == spawnbtn2 ) then local row, col = guiGridListGetSelectedItem( spawnG2 ) local name = guiGridListGetItemText( spawnG2, row, col ) if name == "Tiger I Ausf E" then local id = 270 triggerServerEvent("spawn_tiger", getLocalPlayer(), id) guiSetVisible(classWnd, false) showCursor(false) elseif name == "King Tiger II" then local id = 127 triggerServerEvent("spawn_tiger2", getLocalPlayer(), id) guiSetVisible(classWnd, false) showCursor(false) end end end addEventHandler("onClientGUIClick",root,joinAxis) addEventHandler("onClientGUIClick",root,joinSwag) addEvent("showGUI", true) function guishow(player) guiSetVisible(classWnd, true) showCursor(true) sound = playSound("music/music.mp3") setSoundVolume(sound, 0.5) end addEventHandler("showGUI",getRootElement(),guishow) --music local sound function startSound (killer, weapon, bodypart) sound = playSound("music/music.mp3", true) setSoundVolume(sound, 0.5) end addEventHandler("onClientPlayerWasted", getResourceRootElement(getThisResource()), startSound) function destroySound() if isElement(sound) then destroyElement(sound) end end addEventHandler("onClientPlayerSpawn", getResourceRootElement(getThisResource(), destroySound) META.XML "WW2" author="Xwad" version="1.0" type="gamemode" />
-
still not working with the same debug:/ Maybe the problem is becaouse i have another background music?
-
Hi i want to add a music to my spawn. I set that the music will start when i die and stop when i spawn but its not working:/ debugscript: WARNING: WW2/spawn/client.lua:98: Bad 'sound/player' pointer @ 'setSoundVolume'(1) part of the script: CLIENT.LUA --music function startSound (killer, weapon, bodypart) local sound = playSound("music/music.mp3") --Play wasted.mp3 from the sounds folder setSoundVolume(sound, 0.5) -- set the sound volume to 50% end addEventHandler("onClientPlayerWasted", getLocalPlayer(), startSound) --add the event handler function stopSound() stopSound("music.mp3") end addEventHandler("onClientPlayerSpawn", getLocalPlayer(), stopSound) --add the event handler
-
the problem is that the player needs to spawn first to warp in a vehicle:D
-
So is it impossible to make that script? But thanks for your help! maybe with setElementHealth?
-
why? maybe we can make it with setElementHealth no?
-
Its not working:/ But where is the id defined?
-
its not working when i shoot the rhino with the rhino only if i hit it with the rhinos body
-
Its still not working and no debugscript
-
eeror loading script failed: scope=client.lua64: 'end' expected to close 'function' at line 19) near ' '
-
Yeah it van be make that way but its not good for me becaouse i have a tanks sking and if i make a tower turret with an object that the skin will not ratate
-
Hi. I want to make a script that makes possible that when i press mouse2 in the rhino then it will aim with a scope. Here is a script but its not working:/ Whats the problem?? local textures = {}; local function render_crosshair () local screenw, screenh = guiGetScreenSize (); local s = screenw * 0.5; local u,v = (screenw - s)*0.5, (screenh - s)*0.5; local black = tocolor (0, 0, 0, 255); dxDrawRectangle (0, 0, screenw, v, black); dxDrawRectangle (0, 0, u, screenh, black); dxDrawRectangle (0, screenh, screenw, -v, black); dxDrawRectangle (screenw, screenh, -u, -screenh, black); dxDrawImage (u, v, screenw-2*u, screenh-2*v, textures ["crosshair_background"]); dxDrawImage (u, v, screenw-2*u, screenh-2*v, textures ["crosshair"]); end; local function on_weapon_aimed (key, state) if isPedInVehicle(source) then if (getElementModel(source) == 432) then if state == "down" then showPlayerHudComponent ("crosshair", false); addEventHandler ("onClientHUDRender", getRootElement (), render_crosshair); else removeEventHandler ("onClientHUDRender", getRootElement (), render_crosshair); end; end; end; addEventHandler ("onClientResourceStart", getResourceRootElement (getThisResource ()), function () -- load textures. textures ["crosshair"] = dxCreateTexture ("images/PKS-07_crosshair.png", "argb", true, "wrap"); if not textures ["crosshair"] then outputDebugString ("failed to load \"images/PKS-07_crosshair.png\" texture", 1); return; end; textures ["crosshair_background"] = dxCreateTexture ("images/PKS-07_crosshair_background.png", "argb", true, "wrap"); if not textures ["crosshair_background"] then outputDebugString ("failed to load \"images/PKS-07_crosshair_background.png\" texture", 1); return; end; bindKey ("aim_weapon", "both", on_weapon_aimed); addEventHandler ("onClientPlayerWeaponSwitch", getRootElement (), function (previousWeaponSlot) local weaponslot_type_sniper = 6; if previousWeaponSlot == weaponslot_type_sniper then if not isPlayerHudComponentVisible ("crosshair") then showPlayerHudComponent ("crosshair", true); end; end; end); end); addEventHandler ("onClientResourceStop", getResourceRootElement (getThisResource ()), function () unbindKey ("aim_weapon", "both", on_weapon_aimed); if not isPlayerHudComponentVisible ("crosshair") then showPlayerHudComponent ("crosshair", true); end; end);
-
Its not working:/ function teamkill(attacker, target ) if isPedInVehicle(attacter) then if (getElementModel ( attacker ) == 432) == true then if (getElementModel ( target ) == 432) == true then outputChatBox ( "Don't attack friendly tanks!",attacker, 255, 0, 0 ) cancelEvent() end end end end addEventHandler ( "onClientVehicleDamage", root, teamkill )
-
Thanks. I tryed to make it but its not working:/ The debugscript said something problem with 'then' function teamkill(attacker, target ) if isPedInVehicle(attacter) then if getElementModel( attacker ) == 432) == true then if getElementModel( target ) == 432) == true then outputChatBox ( "Don't attack friendly tanks!",attacker, 255, 0, 0 ) cancelEvent() end end end end addEventHandler ( "onClientVehicleDamage", root, teamkill )
-
hi! What funvtions need i use to make a script that disables the explosion demage on the rhino if a rhino shot it. I mean if i shoot the rhino with a rhino then the rhino will not demaged.