
xXMADEXx
Members-
Posts
2,718 -
Joined
-
Last visited
Everything posted by xXMADEXx
-
Thank you castillo, sorry for the noob mistake.
-
Hey guys, im trying to make a turf system, and for some reason the color returns as "nil". I asked Castillo and he dosn't know (prob just didn't take time) but here is my code: (server) function colors(player) --local gangName = exports['gang']:getPlayerGang(player) return unpack(exports['gang']:getGangColor(exports['gang']:getPlayerGang(player))) end
-
Groups are mostly for RPG servers, and the MTA Team makes functions for everything, not just one genre of servers.
-
Let me just say this, YOUR A GREAT MAPPER!
-
Wow! This is an awsome map.
-
This is a client side script...
-
Try this function ofrecerse(plr) if (getElementData(plr,"Occupation")=="Prostituta") then local x,y,z = getElementPosition(plr) markerProsti = createMarker( x, y, z-1, "cylinder", 1.5, 175, 0, 255, 150 ) setElementFrozen ( plr, true ) setElementData(plr, "Occupation", "Prostituta on") else setElementFrozen ( plr, false ) setElementData(plr, "Occupation", "Prostituta") destroyElement(markerProsti) end end addCommandHandler("ofrecerme", ofrecerse)
-
Hey guys, i have made this basic script, but i dont know how to make the dx text count. function timerText() dxDrawBorderedTitleText("Time Left: ", 0, 0, 1279, 65, tocolor(0, 255, 255, 255), 2, "default", "center", "center", false, false, true, false, false) end function startJailGUITimer(player,timer) addEventHandler('onClientRender',root,timerText) setTimer( function () removeEventHandler("onClientRender",root,timerText) end, timer * 1000, 1 ) end addEvent("jail:startDxTimer",true) addEventHandler("jail:startDxTimer",root,startJailGUITimer)
-
Read this: https://wiki.multitheftauto.com/wiki/Gui ... rogressBar
-
You can just use a default mta resource named "realdriveby". ( https://community.multitheftauto.com/index.php?p= ... ails&id=57 )
-
Try to convert the map to lua, using http://gtamap.delux-host.com/converter/
-
So, i made a basic police GUI, and for some reason, if one player has a wanted level it will list every player saying they have the same wanted level for id, player in ipairs(getElementsByType("player")) do if (getPlayerWantedLevel(player) > 0) then local x,y,z = getElementPosition(player) row = guiGridListAddRow(playerList) guiGridListSetItemText ( playerList, row, column_name, getPlayerName(player), false, false ) guiGridListSetItemText ( playerList, row, column_wanted, getPlayerWantedLevel(player), false, false ) guiGridListSetItemText ( playerList, row, column_area, getZoneName(x,y,z), false, false ) guiGridListSetItemText ( playerList, row, column_city, getZoneName(x,y,z,true), false, false ) guiGridListSetItemText ( playerList, row, column_team, getTeamName(getPlayerTeam(player)), false, false ) end end
-
Im trying to make this script, so that if theprisoner is in a car, and the cop gets far away, it will warp the ped out of the vehicle. --FORCES A PRISONER TO FOLLOW THE COP function walktheprisoner(thecop, theprisoner) if (getElementData ( theprisoner, "currentstatus" ) == "underarrest") and (getPedOccupiedVehicle ( theprisoner ) == false ) then local copx, copy, copz = getElementPosition ( thecop ) local prisonerx, prisonery, prisonerz = getElementPosition ( theprisoner ) copangle = ( 360 - math.deg ( math.atan2 ( ( copx - prisonerx ), ( copy - prisonery ) ) ) ) % 360 setPedRotation ( theprisoner, copangle ) setCameraTarget ( theprisoner, theprisoner ) local dist = getDistanceBetweenPoints2D ( copx, copy, prisonerx, prisonery ) if ( dist > 16 ) then local car = getPedOccupiedVehicle(theprisoner) if (car) then removePedFromVehicle(theprisoner) end setControlState ( theprisoner, "sprint", false ) setControlState ( theprisoner, "walk", false ) setControlState ( theprisoner, "forwards", false ) setControlState ( theprisoner, "jump", false ) setElementPosition(theprisoner, copx, copy+0.5, copz+1) local zombify = setTimer ( walktheprisoner, 500, 1, thecop, theprisoner ) elseif ( dist > 12 ) then setControlState ( theprisoner, "sprint", true ) setControlState ( theprisoner, "walk", false ) setControlState ( theprisoner, "forwards", true ) setControlState ( theprisoner, "jump", false ) local zombify = setTimer ( walktheprisoner, 500, 1, thecop, theprisoner ) elseif ( dist > 6 ) then setControlState ( theprisoner, "sprint", false ) setControlState ( theprisoner, "walk", false ) setControlState ( theprisoner, "forwards", true ) setControlState ( theprisoner, "jump", false ) local zombify = setTimer ( walktheprisoner, 500, 1, thecop, theprisoner ) elseif ( dist > 1.5 ) then setControlState ( theprisoner, "sprint", false ) setControlState ( theprisoner, "walk", true ) setControlState ( theprisoner, "forwards", true ) setControlState ( theprisoner, "jump", false ) local zombify = setTimer ( walktheprisoner, 500, 1, thecop, theprisoner ) elseif ( dist < 1.5 ) then setControlState ( theprisoner, "sprint", false ) setControlState ( theprisoner, "walk", false ) setControlState ( theprisoner, "forwards", false ) setControlState ( theprisoner, "jump", false ) local zombify = setTimer ( walktheprisoner, 500, 1, thecop, theprisoner ) end end end
-
oh
-
No errors show in debugscript...
-
Hey everyone! I got the legalsystem to work, but now i am editing the way it arrests and the distance stuff. I am trying to make the prisoner warp to the cop, but when the prisoner warps, he will not move at all. I am not sure how to fix this problem. Thanks --FORCES A PRISONER TO FOLLOW THE COP function walktheprisoner(thecop, theprisoner) if (getElementData ( theprisoner, "currentstatus" ) == "underarrest") and (getPedOccupiedVehicle ( theprisoner ) == false ) then local copx, copy, copz = getElementPosition ( thecop ) local prisonerx, prisonery, prisonerz = getElementPosition ( theprisoner ) copangle = ( 360 - math.deg ( math.atan2 ( ( copx - prisonerx ), ( copy - prisonery ) ) ) ) % 360 setPedRotation ( theprisoner, copangle ) setCameraTarget ( theprisoner, theprisoner ) local dist = getDistanceBetweenPoints2D ( copx, copy, prisonerx, prisonery ) if ( dist > 16 ) then setControlState ( theprisoner, "sprint", false ) setControlState ( theprisoner, "walk", false ) setControlState ( theprisoner, "forwards", false ) setControlState ( theprisoner, "jump", false ) setElementPosition(theprisoner, copx, copy+0.5, copz+1) setPedRotation ( theprisoner, copangle ) elseif ( dist > 12 ) then setControlState ( theprisoner, "sprint", true ) setControlState ( theprisoner, "walk", false ) setControlState ( theprisoner, "forwards", true ) setControlState ( theprisoner, "jump", false ) local zombify = setTimer ( walktheprisoner, 500, 1, thecop, theprisoner ) elseif ( dist > 6 ) then setControlState ( theprisoner, "sprint", false ) setControlState ( theprisoner, "walk", false ) setControlState ( theprisoner, "forwards", true ) setControlState ( theprisoner, "jump", false ) local zombify = setTimer ( walktheprisoner, 500, 1, thecop, theprisoner ) elseif ( dist > 1.5 ) then setControlState ( theprisoner, "sprint", false ) setControlState ( theprisoner, "walk", true ) setControlState ( theprisoner, "forwards", true ) setControlState ( theprisoner, "jump", false ) local zombify = setTimer ( walktheprisoner, 500, 1, thecop, theprisoner ) elseif ( dist < 1.5 ) then setControlState ( theprisoner, "sprint", false ) setControlState ( theprisoner, "walk", false ) setControlState ( theprisoner, "forwards", false ) setControlState ( theprisoner, "jump", false ) local zombify = setTimer ( walktheprisoner, 500, 1, thecop, theprisoner ) end end end Then, when i do this, he does nothing but run forward. Dosn't rotate. setControlState ( theprisoner, "sprint", false) setControlState ( theprisoner, "walk", true) setControlState ( theprisoner, "forwards", false ) setControlState ( theprisoner, "jump", false )
-
That is the script, of Valhalla.
-
I know how to make gates, but not all people do.
-
Hey MTA community, i have made this mechanic script, but it keeps saying "This vehicle has no driver."... no idea why. function fix (player) local car = getPedOccupiedVehicle(player) local driver = getVehicleOccupant (player) local equation = 1500 - getElementHealth(car) if (getElementData(player,"Job")=="Mechanic") then if (getPedOccupiedVehicleSeat(player)==0) then outputChatBox("You cannot fix a vehicle, from the driver seat.",player,255,0,0) else if (driver) then if (getPlayerMoney(driver) > equation ) then takePlayerMoney(driver,equation) givePlayerMoney(player,equation) triggerClientEvent(driver,"message:addMessage",driver,"Mechanic: "..getPlayerName(player).." has fixed your vehicle for $"..equation.."!") triggerClientEvent(player,"message:addMessage",player,"Mechanic: You have fixed "..getPlayerName(driver).."'s vehicle for "..equation.."!") else outputChatBox("The driver dosn't have $"..equation.." to repair the vehicle!",player,255,0,0) outputChatBox("You don't have "..equation.." to repair this vehicle.",driver,255,0,0) end else outputChatBox("This vehicle has no driver.",player,255,0,0) end end end end addCommandHandler('fix',fix)
-
I ended up with this code, but no luck addEventHandler("onPlayerDamage ",root, function (attacker,weapon) if (getElementData(attacker,"Job")=="Medic") then if (weapon==14) then if (getElementHealth(source) < 100) then givePlayerMoney(attacker,350 - getElementHealth(source)) takePlayerMoney(source,350 - getElementHealth(source)) setElementHealth(source,getElementHealth(source) + 20) triggerClientEvent(attacker,'message:addMessage',attacker,'Medic: You healed '..getPlayerName(source)) triggerClientEvent(source,'message:addMessage',source,"Medic: "..getPlayerName(attacker).." has healed you.") else triggerClientEvent(attacker,"message:addMessage",attacker,"Medic: "..getPlayerName(source).." is not injured.") end end end end )
-
hum.. Ill try on server side
-
Hey guys, i made this basic medic script, but for some reason it will not take money from the source, or give money to the attacker... Any advice? addEventHandler('onClientPlayerDamage',root, function (attacker,weapon) if (getElementData(attacker,"Job")=="Medic") then if (weapon == 14) then if (getElementHealth(source) < 100) then takePlayerMoney(source,200-getElementHealth(source)) givePlayerMoney(attacker,200-getElementHealth(source)) triggerEvent("message:addMessage",attacker,"Medic: You have healed "..getPlayerName(source)) setElementHealth(source,getElementHealth(source) + 20) else triggerEvent("message:addMessage",attacker,"Medic: "..getPlayerName(source).." is not injured.") end end end end )