-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
There you go: http://www.mediafire.com/?zrdzbeq8k4l86rk
-
Creating this script would take about 2 mins (even less). local playerObjects = {} function attachObjectToPlayerVehicle ( player, cmd, ID, x, y, z, rx, ry, rz ) local vehicle = getPedOccupiedVehicle(player) if not vehicle then outputChatBox("You must be in a vehicle to use this command.",player,255,0,0) return end if isElement(playerObjects[player]) then destroyElement(playerObjects[player] end playerObjects[player] = createObject(tonumber(ID),0,0,0) attachElements (vehicle, playerObjects[player], tostring(x), tostring(y), tostring(z), tostring(rx), tostring(ry), tostring(rz)) end addCommandHandler ( "attach", attachObjectToPlayerVehicle ) addEventHandler("onPlayerQuit",root, function () if isElement(playerObjects[source]) then destroyElement(playerObjects[source] end end) It should work
-
Seems like your TXD is wrong, i've tested with another TXD file and doesn't output any error.
-
function createLoginWindow() wdwLogin = guiCreateWindow(787,419,187,323,"Login System by Sparrow",true) lblUser = guiCreateLabel(22,40,142,17,"Username ",true,wdwLogin) lblPass = guiCreateLabel(25,167,127,20,"Password",true,wdwLogin) edtUser = guiCreateEdit(21,71,141,32,"",true,wdwLogin) edtPass = guiCreateEdit(23,202,141,32,"",true,wdwLogin) guiEditSetMaxLength(edtUser, 50) guiEditSetMaxLength(edtPass, 50) btnLogin = guiCreateButton(31,263,133,41,"Login",true,wdwLogin) guiSetFont(btnLogin,"sa-header") guiSetVisible(wdwLogin, true) addEventHandler("onClientGUIClick", btnLogin, clientSubmitLogin, false) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResouce()), function () createLoginWindow() outPutChatBox("Welcome to MTA:SA Server, please log in.") if (wdwLogin ~= nil) then guiSetVisible (wdwLogin ,true) else outPutChatBox("An unexpected error was ocurred and the log in Window was not created") end showCursor(true) guiSetInputEnbled(true) end ) function clientSubmitLogin (button,state) if button == "left" and state =="up" then guiSetInputEnabled(false) guiSetVisible(wdwLogin, false) showCursor(false) end end function clientSubmitLogin (button,state) if button =="left" and state == "up" then local username = getGuiText(edtUser) local password =getGuiText(edtPass) if username and password then triggerServerEvent("submitLogin", getRootElement (), username, password) guiSetInputEnable(false) guiSetVisible(wdwLogin, false) else outputChatBox("Please enter a username and password") end end end
-
I don't think so, but you should take a look at the heligrab resource......
-
Your XML file is wrong, use this: <catalog type="icon"> <icon name="Arrow" id="1559" /> <icon name="Horse Shoe" id="954" /> <icon name="Money" id="1212" /> <icon name="Newbie (Info Icon)" id="1239" /> <icon name="Fall in Love" id="1240" /> <icon name="Drug" id="1241" /> <icon name="Safe" id="1242" /> <icon name="I am popular" id="1247" /> <icon name="Serial Killer" id="1254" /> <icon name="Rich" id="1274" /> <icon name="Poorid" id="1275" /> <icon name="Magic" id="1276" /> <icon name="Hunger" id="2768" /> <icon name="Strong" id="2916" /> <icon name="Searching Strange Things" id="953" /> </catalog>
-
1: OK. 2: You need to use the Engine functions: https://wiki.multitheftauto.com/wiki/Cli ... _functions 3: You can't as far as I know. 4: There are no resources to do that, but maybe you could make the first one.
-
1: You can't do that as far as I know, but you could create your own HUD. 2: You can change some weapon textures, not models (DFF). 3: I don't know what are you talking about. 4: https://community.multitheftauto.com/index.php?p= ... ils&id=357
-
Wrong section, it should go here: https://forum.multitheftauto.com/viewfor ... 6d93bbafe5
-
There are some resources in the MTA community, you could look how they did it. https://community.multitheftauto.com/index.php?p= ... ils&id=528 https://community.multitheftauto.com/index.php?p= ... ils&id=556 Good luck.
-
I don't know why, but this function is outdated if i'm right, and we should use addBan instead.
-
Yeah..... my mistake , btw, use addBan, banPlayer won't work. kufurtablo = { "son of a bitch", } addEventHandler('onPlayerChat', root, function(msg, msgType) if msgType == 0 then for i,v in pairs(kufurtablo) do local str = string.lower ( msg ) if ( string.find ( str, v ) ) then addBan( nil, nil, getPlayerSerial(source), nil, 'Bad word', 12000 ) break end end end end )
-
kufurtablo = { "son of a bitch", } addEventHandler('onPlayerChat', root, function(msg, msgType) if msgType == 0 then for i,v in pairs(kufurtablo) do local str = string.lower ( v ) if ( string.find ( str, v ) ) then addBan( nil, nil, getPlayerSerial(source), nil, 'Bad word', 12000 ) break end end end end )
-
addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function () for index,player in pairs(getElementsByType("player")) do bindKey(player,"F1","down",startJob) end end) addEventHandler("onPlayerJoin",getRootElement(), function () bindKey(source,"F1","down",startJob) end) function startJob ( playerSource ) local x, y, z = getElementPosition ( playerSource ) if ( chauffeurSkins[getElementModel ( playerSource )] ) then if not playerClients[ playerSource ] then local numLocations = #taxiLocations if ( numLocations > 0 ) then repeatCount = 0; repeat local pickupPoint = math.random(numLocations) pickupx = taxiLocations[pickupPoint]["x"] pickupy = taxiLocations[pickupPoint]["y"] pickupz = taxiLocations[pickupPoint]["z"] pickupr = taxiLocations[pickupPoint]["r"] local jobDistance = getDistanceBetweenPoints3D ( x, y, z, pickupx, pickupy, pickupz ); repeatCount = repeatCount+1 until jobDistance > 100 and jobDistance < 800 + repeatCount*100 repeat local id = math.random( 10, 270 ) ped = createPed( tonumber( id ), pickupx, pickupy, pickupz ) setPedRotation ( ped, pickupr ) until ped playerClients[ playerSource ] = { }; table.insert( playerClients[ playerSource ], ped ); table.insert( jobClients, ped ); local pedBlip = createBlipAttachedTo ( ped, 41, 2, 255, 0, 0, 255, 1, 99999.0, playerSource) playerBlips[ playerSource ] = { }; table.insert( playerBlips[ playerSource ], pedBlip ); pedMarker = createMarker ( pickupx, pickupy, 0, cylinder, 6.5, 255, 255, 0, 150, playerSource) playerCols[ playerSource ] = { }; table.insert( playerCols[ playerSource ], pedMarker ); addEventHandler( "onMarkerHit", pedMarker, arrivePickup ) outputChatBox ( "Pickup the passenger located at the marker.", playerSource ); else outputChatBox ( "No passenger pickup points specified, contact an admin!", playerSource ); end else outputChatBox ( "You allready have an assignment!", source ); end else outputChatBox ( "You don't have a job!", source ); end end addCommandHandler ("startjob", startJob)
-
Lol, my bad, fixed.
-
No problem.
-
Why noob? if i'm right, this resource is the same as: https://community.multitheftauto.com/index.php?p= ... ls&id=2385
-
Lo siento, pero no se mucho de mysql, me temo que en esto no te puedo ayudar.
-
addEventHandler("onVehicleEnter", getRootElement(), function(thePlayer, seat, jacked) currentElement = createObject(360, 0.0, 0.0, 0.0) attachElements(currentElement, source, 0.0, 1.8, 0.0, 0.0, 0.0, 90.0) end) function removeobject ( thePlayer, seat, jacked ) local attached = getAttachedElements (source) if (attached) then for i,element in ipairs(attached) do if getElementType (element) ~= "object" then return end destroyElement(element) end end end addEventHandler ( "onVehicleExit", getRootElement(), removeobject ) addEventHandler ("onVehicleExplode", getRootElement(), removeobject) Works ( tested ).
-
No problem .
-
addEventHandler("onVehicleEnter", getRootElement(), function(thePlayer, seat, jacked) currentElement = createObject(360, 0.0, 0.0, 0.0) attachElements(currentElement, source, 0.0, 1.8, 0.0, 0.0, 0.0, 90.0) end) function removeobject ( thePlayer, seat, jacked ) occupiedVehicle = getPedOccupiedVehicle( thePlayer ) local attached = getElementAttachedTo ( source ) destroyElement ( attached ) end addEventHandler ( "onVehicleExit", getRootElement(), removeobject ) addEventHandler ("onVehicleExplode", getRootElement(), removeobject) Try that? the source of onVehicleEnter is the vehicle the player just entered.
-
The event is wrong, check this: "hideDX " it has an SPACE. function drawDX () X,Y = guiGetScreenSize () X = X * (2.5/3) Y = Y * (1/4) dxDrawText ( getElementData(getLocalPlayer(),"secondsRemaining"), X, Y, X, Y, tocolor(255, 255, 255, 255), 5) end function showDX () addEventHandler ( "onClientRender", getRootElement(), drawDX ) end addEvent ( "showDX", true ) addEventHandler ( "showDX", getRootElement(), showDX ) function hideDX () removeEventHandler ( "onClientRender", getRootElement(), drawDX ) end addEvent ( "hideDX", true ) addEventHandler ( "hideDX", getRootElement(), hideDX ) Now it's removing the text.
-
You only have to cancel the onClientPlayerDamage event. addEventHandler("onClientPlayerDamage",getRootElement(), cancelEvent)
