
GamerDeMTA
Members-
Posts
559 -
Joined
-
Last visited
Everything posted by GamerDeMTA
-
and for kill the ped by command, BUT!!! when the player writes the command he must wait 5 seconds
-
Nobody can help me?
-
When I buy that drugs I see my screen BLACK. https://community.multitheftauto.com/ind ... ils&id=963 lua 1 function timeCheck() local hh, mm = getTime() if (hh<7) then local ww, bb = getWeather() if (ww ~= -52123) then setWeather(-52123) end else local ww, bb = getWeather() if (ww ~= 190) then setWeather(190) end end end function fall() if (isDrugActive) then setPedAnimation(getLocalPlayer(), "ped", "getup_front",1000, false, false) setTimer(function() fall() end, math.random(10000, 30000), 1) setTimer(function() setControlState ('jump',true) end, 1500, 1) setTimer(function() setControlState ('jump',false) end, 2000, 1) end end function fades() local rnd = math.random(2,4) fadeCamera(false, rnd, math.random(1,255), math.random(1,255), math.random(1,255)) local xx, yy, zz = getElementPosition(getLocalPlayer()) setTimer(function() fadeCamera(true, 1) end, rnd*1000/2, 1) end function drugSteer() left=false right=false up=false down=false local keys = getBoundKeys ('vehicle_left') if keys then tmpLeft = false for keyName, state in pairs(keys) do if (getKeyState(keyName)) then tmpLeft=true end end if tmpLeft then left=true right=false end end local keys = getBoundKeys ('vehicle_right') if keys then tmpRight = false for keyName, state in pairs(keys) do if (getKeyState(keyName)) then tmpRight=true end end if tmpRight then left=false right=true end end if (left) then setControlState('vehicle_left', false) setControlState('vehicle_right', true) elseif (right) then setControlState('vehicle_right', false) setControlState('vehicle_left', true) else setControlState('vehicle_right', false) setControlState('vehicle_left', false) end local keys = getBoundKeys ('accelerate') if keys then tmpUp = false for keyName, state in pairs(keys) do if (getKeyState(keyName)) then tmpUp=true end end if tmpUp then down=false up=true end end local keys = getBoundKeys ('brake_reverse') if keys then tmpDown = false for keyName, state in pairs(keys) do if (getKeyState(keyName)) then tmpDown=true end end if tmpDown then down=true up=false end end if (up) then setControlState('accelerate', false) setControlState('brake_reverse', true) elseif (down) then setControlState('brake_reverse', false) setControlState('accelerate', true) else setControlState('brake_reverse', false) setControlState('accelerate', false) end end roll = 0 rollGrow = false function drugCam() if (rollGrow) then if (roll > 15) then rollGrow = false end roll = roll + 1 else if (roll < -15) then rollGrow = true end roll = roll -1 end local xx, yy, zz = getElementPosition(getLocalPlayer()) local rot = getPedRotation(getLocalPlayer()) local lx = xx + math.sin (math.rad(-rot)) * -10 local ly = yy + math.cos (math.rad(-rot)) * -10 setCameraMatrix(lx, ly, zz + 4, xx, yy, zz, roll) fxAddBlood(xx, yy, zz, 0, 0, 0, 6) end function startDrug(time) fadeCamera(false) setTimer(function(time) if (time == nil) then time = 10*1000 else if (tonumber(time) < 5000) then tiaaame = 10*1000 end end timerWeather = setTimer(function() timeCheck() end, 1000) timerFades = setTimer(function() fades() end, 4000) isDrugActive = true setTimer(function() fall() end, 1000, 1) addEventHandler("onClientRender", getRootElement(), drugSteer) addEventHandler("onClientPreRender", getRootElement(), drugCam) setTimer(function() stopDrug() end, time, 1) end, 1500, 1, time) end function stopDrug() fadeCamera(false) killTimer(timerFades) killTimer(timerWeather) isDrugActive = false fadeCamera(false) removeEventHandler("onClientRender", getRootElement(), drugSteer) removeEventHandler("onClientPreRender", getRootElement(), drugCam) fadeCamera(false) triggerServerEvent("restoreWeather", getLocalPlayer()) setTimer(function() setCameraTarget(getLocalPlayer()) fadeCamera(true) end, 2500, 1) end function startDrug2() startDrug(4) end function stopDrug2() stopDrug() end --addCommandHandler("sd", startDrug2) --addCommandHandler("sds", stopDrug2) function restoreWeather(ww) setWeather(ww) end addEvent("restoreWeather", true) addEventHandler("restoreWeather", getRootElement(), restoreWeather) function missionStart(whichMouse, state, absoluteX, absoluteY) local number = getElementData(source,"number") -- this is the button "id" local money=getPlayerMoney(getLocalPlayer()) if (number=='a') then if (money>=1000) then startDrug(1*60*1000) triggerServerEvent("takeMoney", getLocalPlayer(),1000) else outputChatBox("You don't have the money!", 255, 0, 0) end elseif (number=='b') then if (money>=3000) then startDrug(3*60*1000) triggerServerEvent("takeMoney", getLocalPlayer(),3000) else outputChatBox("You don't have the money!", 255, 0, 0) end elseif (number=='c') then if (money>=5000) then startDrug(6*60*1000) triggerServerEvent("takeMoney", getLocalPlayer(),5000) else outputChatBox("You don't have the money!", 255, 0, 0) end else if (money>=8000) then startDrug(10*60*1000) triggerServerEvent("takeMoney", getLocalPlayer(),8000) else outputChatBox("You don't have the money!", 255, 0, 0) end end --outputChatBox("#00ff00\"dfdf\" #ffffff started!",255,255,255,true) guiSetVisible (missionSelectWindow1, false) showCursor (false) end -- this fires when player hits the marker function missionSelect(hitPlayer, matchingDimension) if (hitPlayer == getLocalPlayer()) and (isPedOnGround (getLocalPlayer()) and not isPedInVehicle(hitPlayer)) then if isDrugActive then outputChatBox("You are already drugged! Do you want to die?!", 255, 0, 0) else guiSetVisible (missionSelectWindow1, true) guiBringToFront (missionSelectWindow1) showCursor (true) end end end function guiCancel () guiSetVisible (missionSelectWindow1, false)
-
.__. Maybe some help?.
-
ah Thanks
-
but I saw one post in which Castillo solved a problem of a resource only changing from ZIP to folder
-
What's the difference?
-
I want to do a Drug Shop & when a player buys it, he can sell drug. I can do that?
-
I want to put in all the screen an Image when a player clicks a button from a GUI, but only for two minutes, also change the Gamemode FROM THE USER WHO DOES IT, not root, to 0.6.
-
Can you send me the link?
-
Can I do an arrow instead of a cilynder with this?
GamerDeMTA replied to GamerDeMTA's topic in Scripting
This script will work so? I used that. marker = createMarker ( -651.29998779297,954.29998779297,11.10000038147, "cylinder", 2, 0, 255, 0, 225 ) addEventHandler("onMarkerHit",marker, function (player) if (getElementType(player) == "player") then setElementModel (player,2) end end ) -
I did but there isn't a file called "bookmarks.xml".
-
I saw that Notepad++ it's recommended by MTA Team in Wiki, also that Castillo uses Notepad++, so I wanted to see the people's opinion.
-
But that puts the image when I attack someone, can you say me to put the image when a player has 10 Health or less, and when he recuperates the health image isn't, also when he die the image isn't? No with attacking.
-
Pai[N] Code doesn't work, I only deleted the outputchatbox. Ah, but that code you posted Pres[T]ege does what I want? I also want when a player recuperate health [i've a script that does that] the image isn't showed, not only when the player die
-
Why SetTimer? Does that script to hide the IMG when the player dies and recuperate health?
-
Can give me a full code with when you die and recuperate health the image sets false / isn't in screen?
-
But I have a script that recuperates health in my server, and when the player recuperates the health he still has the Image, without die, so what about that?
-
Gracias Castillo, but it has a bug. Can you say me how to fix this? When I get killed the IMG stays and when I recuperate health too.
-
Now it works but the IMG is in a corner Can you say me how to put the Image around all the screen?
-
And GIFs when a player joins?
-
with the Panel or doing /sethealth I set my health
-
Still doesn't works I don't know why, I put my health as 10 and the image isn't showed and the outputchatbox too