-
Posts
1,363 -
Joined
-
Last visited
Everything posted by Max+
-
well Solid he mean if you buy let's say M4 ( 20 times ) you get around 600 - 1000 ammo , but when he save the weapon and quit then login , the ammo set to 100 while it should be 600 - 1000 ammo ..
-
chaseanim isn't defined . . .
-
your welcome , take a look here , https://wiki.multitheftauto.com/wiki/Meta.xml
-
you can Start From Here , https://wiki.multitheftauto.com/wiki/On ... ateMessage Example - -- # Server Side addEventHandler ( "onPlayerPrivateMessage",root, function ( ) --- Code Here , end )
-
if you want remove the color Hex, Code Use, what Hypex post , ...
-
لول بقوه 60 دولار ؟ ؟ يارجل مبرمجين محترفين مثل SolidSnake14 ماحطو السعر ذا . . .
-
شوف الويكي , This function gets the position of the camera and the position of the point it is facing. هاذا الكود يقوم بأحضار احداثيات الكاميرا , ياليت توضح لنا وش تبي بالضبط , عشان نعرف نساعدك ,
-
حبيبي , ادري ماراح ياخذ , اذا فلوسه اكثر ,انا مسوي التحقق عشان كذا يعني اذا فلوسه 500 ماياخذ معونه , اما فلوسه اقل ,من 500 ياخذ , وبالنسبة للخبص , تقصد localPlayer ? ادري , ماودي اكمل له السكربت , ودي يتعلم , انا كنت زيه حقيقة , مره ماعرف , شي الحين اصحح بعض السكربتات , وانا ماتوقعت اعرف اصحهها ,
-
Yes i did and it's hide after select the participateButton and take money , also with canseButton and show when hit the marker next the airport but i dont have the resource exports.CSUtexts:output to test rest of it ,
-
فيه طريقة اخرى , if (getPlayerMoney(localPlayer) >= 500) then outputChatBox ( "~•][لايمكنك أخذ المال مرتين][•~ ", player, 63, 252, 41, true ) else givePlayerMoney ( player, 500 ) outputChatBox ( "~•][تم زيادة المؤنة الاسلامية][•~ ", player, 63, 252, 41, true ) end
-
Your welcome Dzsozi
-
well why dont you check for every screen like this , Example , height , width = guiGetScreenSize() scaleX = width scaleY = height if ( scaleX == 1600 and scaleY == 900 ) or ( scaleX == 800 and scaleY == 600 ) then --- do something
-
Now it's working , i Fixed alot of bugs you had , and Fixed the gui , show on start , Fixed ,buttons click , Fixed , money take , Fixed marker , Fixed the count if it's 10 then == start the game , and please learn form these erros , and make sure to organize your code next time ( use shortcuts ) .. . . ---ClientSide, participateWindow = guiCreateWindow(436, 368, 448, 220, "CSU DD Event", false) guiWindowSetSizable(participateWindow, false) participateButton = guiCreateButton(76, 150, 128, 43, "Participate", false, participateWindow) guiSetFont(participateButton, "default-bold-small") participateLabel = guiCreateLabel(10, 21, 432, 127, "Hello "..getPlayerName(localPlayer)..", you are about to participate in dd event, \nwhere you can kill people by car, with shooting them rockets from car. Click \nbutton Participate, but it costs 5,000$. \nIf you don't want to participate, or lose 5,000$ click Cansel Button. \nBut also you must know that, if you win this event you will get \n50,000$.", false, participateWindow) guiSetFont(participateLabel, "clear-normal") canselButton = guiCreateButton(233, 150, 128, 43, "Cansel", false, participateWindow) guiSetFont(canselButton, "default-bold-small") addEventHandler('onClientGUIClick', root, function () if ( source == participateButton ) then guiSetVisible(participateWindow, false) showCursor(false) local count = (getElementData(localPlayer,"Your_Data")) or 0 setElementData(localPlayer,"Your_Data", count +1) triggerServerEvent('TakeMoney', localPlayer) exports.CSUtexts:output("You have been participated in event, wait for other players, to participate and when you reach 10 players, event will be started automaticaly.", 255, 255, 0) elseif ( source == canselButton ) then guiSetVisible(participateWindow, false) showCursor(false) end end ) addEventHandler('onClientResourceStart', resourceRoot, function () guiSetVisible(participateWindow, false) showCursor(false) end ) function onQuitGame( ) local count = getElementData(localPlayer,"Your_Data") setElementData(localPlayer,"Your_Data",count -1) exports.CSUtexts:output(""..getPlayerName(localPlayer).." left the event, Paricipate players in event "..count.."", 255, 255, 0) end addEventHandler( "onClientPlayerQuit", getRootElement(), onQuitGame ) addCommandHandler("leavedd", onQuitGame) function checkPlayers() local playersInDD = getElementData(localPlayer,"Your_Data") exports.CSUtexts:output("There are "..playersInDD.."/10 players signed in event", 255, 255, 0) end addCommandHandler("ddevent", checkPlayers) function warpPlayers() if (getElementData(localPlayer,"Your_Data" == 10 )) then exports.CSUtexts:output("10/10 players have signed in event, wait 10 seconds, to be warped.", 255, 255, 0) setTimer(1000, 1) end end addEvent("ShowGUI", true) addEventHandler("ShowGUI", root, function() guiSetVisible(participateWindow, true) showCursor(true) end ) ---ServerSide , local ddmarker = createMarker( 2719, -1828, 11, "cylinder", 2, 255, 255, 0, 170, false ) createBlipAttachedTo(ddmarker, 11) addEventHandler('onMarkerHit', root, function (hitElement) if (getElementType(hitElement) == 'player' ) then triggerClientEvent(hitElement, "ShowGUI", hitElement) end end ) addEvent('TakeMoney' , true) addEventHandler('TakeMoney', root, function () takePlayerMoney(source, 5000) end )
-
Maybe this topic will help you ? https://forum.multitheftauto.com/viewtopic.php?f=91&t=33412
-
Well i dont see any key to open the gui , you want open it with key or on marke hit ?
-
Your Code , has alot of erros , takeMoney wont work , on ClientSide better use , trigger, --ClientSide , local ddmarker = createMarker( 2719, -1828, 11, "cylinder", 2, 255, 255, 0, 170, false ) createBlipAttachedTo(ddmarker, 11) participateWindow = guiCreateWindow(436, 368, 448, 220, "CSU DD Event", false) guiWindowSetSizable(participateWindow, false) participateButton = guiCreateButton(76, 150, 128, 43, "Participate", false, participateWindow) guiSetFont(participateButton, "default-bold-small") participateLabel = guiCreateLabel(10, 21, 432, 127, "Hello "..playerName..", you are about to participate in dd event, \nwhere you can kill people by car, with shooting them rockets from car. Click \nbutton Participate, but it costs 5,000$. \nIf you don't want to participate, or lose 5,000$ click Cansel Button. \nBut also you must know that, if you win this event you will get \n50,000$.", false, participateWindow) guiSetFont(participateLabel, "clear-normal") canselButton = guiCreateButton(233, 150, 128, 43, "Cansel", false, participateWindow) guiSetFont(canselButton, "default-bold-small") guiSetVisible (participateWindow, false) addEventHandler('onClientGUIClick', root, function () if ( localPlayer == participateButton ) then local count = (getElementData(localPlayer,"Your_Data")) if count == false then setElementData ( localPlayer, "Your_Data", "0" ) elseif count == true then setElementData(localPlayer,"Your_Data", count +1) triggerServerEvent('TakeMoney', localPlayer) exports.CSUtexts:output("You have been participated in event, wait for other players, to participate and when you reach 10 players, event will be started automaticaly.", 255, 255, 0) guiSetVisible(participateWindow, false) showCursor(false) elseif ( localPlayer == canselButton ) then guiSetVisible(participateWindow, false) showCursor(false) end end end ) ---ServerSide , addEvent('TakeMoney', true) addEventHandler('TakeMoney', root, function () takePlayerMoney(source, 5000) outputChatBox('we have take $500 for this', source, getRootElement(), 255, 0,0) end ) Edited ,
-
Cant you see onClientPlayerQuit Because there is client , gui functions , client , so it's clientSide ,
-
addEvent("onPlayerPickUpRacePickup", true) addEventHandler("onPlayerPickUpRacePickup", getRootElement(), function(_, pickupType, vehicleModel) if pickupType == "vehiclechange" and vehicleModel == 425 then outputChatBox('[HUNTER] '..getPlayerName(source)..' has reached a Hunter!',getRootElement(),255,0,0) end end)
-
i, worked on fix it , for 3 hours : ( ---ServerSide , addEvent('startTrainJob', true) addEventHandler('startTrainJob', root, function () trainVehicle = createVehicle(538, -1947.7, 140.8, 27.4) warpPedIntoVehicle(source, trainVehicle ) triggerClientEvent('onStartTrain', source) end ) addEvent('onTrainJobFinish', true) addEventHandler('onTrainJobFinish', root, function () destroyElement(trainVehicle) setElementPosition(source, -1964.3, 138, 27.7) setElementRotation(source, 0, 0, 90) outputChatBox('You Made it and got $1000', source, 255,0,0) givePlayerMoney(source, 1000) triggerClientEvent("destroyDestinationMarker", source) end ) addEventHandler("onVehicleExit", trainVehicle, function () triggerClientEvent("destroyDestinationMarker", source) setElementPosition(source, -1964.3, 138, 27.7) setElementRotation(source, 0, 0, 90) end ) ---ClientSide GUIEditor = { memo = {}, button = {}, window = {}, } addEventHandler("onClientResourceStart", resourceRoot, function() slantFont = guiCreateFont( "slant.ttf", 15 ) trainGUI = guiCreateWindow(0.29, 0.24, 0.42, 0.49, "Train Job", true) guiWindowSetSizable(trainGUI, false) guiSetVisible(trainGUI, false) trainStartButton = guiCreateButton(0.60, 0.20, 0.34, 0.17, "Start Job!", true, trainGUI) guiSetFont(trainStartButton, slantFont) guiSetProperty(trainStartButton, "NormalTextColour", "FFAAAAAA") trainCloseButton = guiCreateButton(0.67, 0.61, 0.20, 0.16, "Close", true, trainGUI) guiSetFont(trainCloseButton, slantFont) guiSetProperty(trainCloseButton, "NormalTextColour", "FFAAAAAA") trainGUIMemo = guiCreateMemo(0.08, 0.20, 0.41, 0.67, "Press the 'start job!' button to start the Train Job", true, trainGUI) guiMemoSetReadOnly(trainGUIMemo, true) end ) trainMarker = createMarker(-1958.3, 137.89999, 26.7, 'cylinder', 2.5, 0, 100, 255, 255) addEventHandler('onClientMarkerHit', root, function (hitElement) if getElementType(hitElement) == "player" then guiSetVisible(trainGUI, true) showCursor( true ) end end ) addEventHandler('onClientMarkerLeave', root, function(leaveElement) if getElementType(leaveElement) == 'player' then guiSetVisible (trainGUI, false ) showCursor ( false ) end end ) addEventHandler('onClientGUIClick', root, function () if ( source == trainStartButton ) then triggerServerEvent("startTrainJob", localPlayer) guiSetVisible(trainGUI, false) showCursor( false ) elseif ( source == trainCloseButton ) then guiSetVisible(trainGUU, false ) showCursor (false) end end ) addEvent('onStartTrain', true) addEventHandler('onStartTrain', root, function () destinationMarker = createMarker(1436.6, 2634.2, 9.8, 'cylinder', 7, 0, 100, 255, 255) outputChatBox('Go to your destination Marker ', localPlayer) end ) addEventHandler('onClientMarkerHit', root, function(hitElement) if getElementType(hitElement) == "vehicle" then --- if it was vehicle hit the marker then triggerServerEvent("onTrainJobFinish", hitElement) end end ) addEvent('destroyDestinationMarker', true) addEventHandler('destroyDestinationMarker', root, function () destroyElement(destinationMarker) end ) Next time , try to organize your codes , because i have seen alot of repeating on some functions . . , / use NP++ and save the code with UTF8- Without Bom so it can work on the server correct ,
-
----ClientSide function drawGui() window = guiCreateWindow(697, 440, 511, 205, "parachute", false) guiWindowSetSizable(window, false) yesBtn = guiCreateButton(110, 87, 89, 88, "yes", false, window) guiSetProperty(yesBtn, "NormalTextColour", "FFAAAAAA") noBtn = guiCreateButton(309, 87, 89, 88, "no", false, window) guiSetProperty(noBtn, "NormalTextColour", "FFAAAAAA") lbl = guiCreateLabel(74, 28, 350, 49, "?", false, window) guiLabelSetHorizontalAlign(lbl, "center", false) guiLabelSetVerticalAlign(lbl, "center") end addEvent("showParachuteGUI", true) addEventHandler("showParachuteGUI", getRootElement(), drawGui) function removeGui() if (guiGetVisible(window) == true) then destroyElement(window) end end addEventHandler ("onClientGUIClick", getRootElement(), function () if ( source == yesBtn ) then triggerServerEvent('giveParachuteForPlayer', localPlayer) elseif (source == noBtn ) then guiSetVisible ( window ,false ) end end ) ----ServerSide parachuteMarker = createMarker(1948.7705078125, -2225.1472167969, 13, "cylinder", 1.5, 255, 255, 0, 125) function markerHit(hitElement) if (getElementType(hitElement) == 'player' ) then outputChatBox("it's Working Yeaaah !", hitElement, getRootElement(), 255, 0, 0) triggerClientEvent(hitElement, "showParachuteGUI", hitElement) end end addEventHandler("onMarkerHit", parachuteMarker, markerHit) addEvent('giveParachuteForPlayer', true) addEventHandler('giveParachuteForPlayer', root, function() giveWeapon(source, 46, 1) setElementPosition(source, 1954.33984375, -2224.9919433594, 16.678098678589) outputChatBox('You got a Parachute, go and fall from the sky', source, getRootElement(), 255, 255, 0) end )
-
Ok , Try Change to root on the event to resourceRoot And test it , if it's lag , then there must be, other resource causing the lag,
-
bool addCommandHandler ( string commandName, function handlerFunction, [bool caseSensitive = true] ) I wonder why you put root here. well , Thanks For reminding Me, Fixed ,
-
Well , it's works with https://wiki.multitheftauto.com/wiki/Slothman/Zombies i don't know if DayZ Zombie has , a diffrent functions or not , because i never tested it , i also looked into wiki not resource named DayZ only Slothman,