-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
Yes, it does, do this, move the event handler down the button, into the function.
-
WRONG, you are using onClientResourceStart on a server side script, do you think that would ever work? addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function() samsphere = createColSphere(208.21,1980.58,28.89,300) samsphere1 = createColSphere(208.21,1980.58,28.89,1500) warningsphere = createColSphere(208.21,1980.58,28.89,500) samsite1 = createObject(3884,113.28,1814.28,32.45,0,0,309) samsite2 = createObject(3884,103.83,1901.12,32.45,0,0,309) samsite3 = createObject(3884,161.99,1933.18,32.45,0,0,145) samsite4 = createObject(3884,233.4,1934.85,32.45,0,0,145) samsite5 = createObject(3884,267.36,1895.48,32.45,0,0,145) samsite6 = createObject(3884,166.03,1850.09,32.45,0,0,350) samsite7 = createObject(3884,262.04,1807.5,32.45,0,0,37) end)
-
Do you have these colshapes? because it seems like that's the problem.
-
So, you want to create a own pickup? that's not so hard.. I done it some days ago for my 'horseshoes' script (there was no horseshoe pickup), it's pretty easy, I just made a object + a marker and made it rotate with a little script.
-
Are you using 'interiors' resource?
-
A que te referis? que resource usas? como privados?
-
Soy programador, es facil para mi, pero para los nuevos no, necesitas aprender cosas mas faciles primero. Aca te dejo el link a la wiki del MTA en español (algunas partes nomas). https://wiki.multitheftauto.com/index.ph ... _Principal Suerte.
-
For sure not what Jaysd1 was talking about .
-
Maybe because magnetObject doesn't exist? also, you got a missing 'end'. local magnetMarker = createMarker ( 0, 0, 0, "cylinder", 3, 255, 255, 255, 255 ) function velocityArrow () for i,obj in ipairs (getElementsByType("object")) do if getElementModel(magnetObject) == 2846 then attachElements ( magnetMarker, obj, 0, 0, 0 ) end end end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), velocityArrow) There's something that is confusing me here... you want to attach ONE marker to more than ONE object...? that makes no sense.
-
-- client side vehList = guiCreateGridList ( 0.05, 0.10, 0.90, 0.77, true, window ) vehCol = guiGridListAddColumn ( vehList, "Vehicle", 0.60 ) bullet = guiGridListAddRow ( vehList ) guiGridListSetItemText ( vehList, bullet, vehCol, "Bullet", false, false ) takebutton = guiCreateButton(0.25,0.90,0.20,0.10,"Buy Car",true,window) function spawnTheCar() local row,col = guiGridListGetSelectedItem(vehList) if row and col and row ~= -1 and col ~= -1 then local vehicleName = guiGridListGetItemText(vehList, row, col) triggerServerEvent("vehicle_spawn",getLocalPlayer(),getVehicleModelFromName(vehicleName)) end end addEventHandler("onClientGUIClick",takeButton,spawnTheCar,false) -- server side addEvent("vehicle_spawn",true) addEventHandler("vehicle_spawn",root, function (model) local x, y, z = getElementPosition(source) local theVehicle = createVehicle(tonumber(model), x, y, z) end) Try with that.
-
Esto no es llama "scripter", eso seria un programador, se llaman "scripts". Para los nombres de los coches, intenta con este: https://community.multitheftauto.com/index.php?p= ... ils&id=488
-
-- client side addEvent("onLogin",true) addEventHandler("onLogin",root, function () if isElement(image) then destroyElement(image) end end) -- server side addEventHandler("onPlayerLogin",root, function () triggerClientEvent(source,"onLogin",source) end)
-
Jaysd1, what are you talking about? that XML file is right, he can put anything as name in there, like root, damage and so on.
-
function airForceMove(x,y,z,rotation,skin) if x and y and z and rotation and skin then local accountname = getAccountName (getPlayerAccount(source)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "admin" ) ) then spawnPlayer(source,x,y,z,rotation,skin) setCameraTarget(source,source) end end end addEvent("airForceMove",true) addEventHandler("airForceMove",root,airForceMove)
-
Seriously... what is this? do you even read what the wiki says? or you just copy & paste the function names and think it'll work? this is a mess, I'll try to fix your errors, but try to concentrate a bit more. Here: function policecarsmarkeronStartup () policecarsChangeMarker = createMarker (1567.0947265625, -1607.6402587891, 13.3828125, "cylinder", 1.5, 0, 0, 0, 255, getRootElement()) setElementInterior (policecarsChangeMarker, 0) end addEventHandler("onResourceStart", getRootElement(), policecarsmarkeronStartup) function policecarsmarker (hitPlayer, matchingDimension) if (source == policecarsChangeMarker) then outputChatBox ("Press 1,2,3,4 to select a Police car from 4 cars", hitPlayer, 255, 0, 0, false) outputChatBox ("And press 'enter' when you find a good one", hitPlayer, 255, 0, 0, false) toggleAllControls (hitPlayer, false, true, false) bindKey (hitPlayer, "1", "down", policecarsChangeMarkerBindKeys) bindKey (hitPlayer, "2", "down", policecarsChangeMarkerBindKeys) bindKey (hitPlayer, "3", "down", policecarsChangeMarkerBindKeys) bindKey (hitPlayer, "4", "down", policecarsChangeMarkerBindKeys) bindKey (hitPlayer, "enter", "down", policecarsChangeMarkerBindKeys) end end addEventHandler("onMarkerHit", getRootElement(), policecarsmarker) function policecarsChangeMarkerBindKeys (thePlayer, key, keystate) local x, y, z = getElementPosition(thePlayer) if (key == "1") and (keystate == "down") then local vehicle = createVehicle (404, x, y, z) end if (key == "2") and (keystate == "down") then local vehicle = createVehicle (404, x, y, z) end if (key == "3") and (keystate == "down") then local vehicle = createVehicle (505, x, y, z) end if (key == "4") and (keystate == "down") then local vehicle = createVehicle (442, x, y, z) end if (key == "enter") and (keystate == "down") then toggleAllControls (thePlayer, true, true, true) unbindKey (thePlayer, "1", "down", policecarsChangeMarkerBindKeys) unbindKey (thePlayer, "2", "down", policecarsChangeMarkerBindKeys) unbindKey (thePlayer, "3", "down", policecarsChangeMarkerBindKeys) unbindKey (thePlayer, "4", "down", policecarsChangeMarkerBindKeys) unbindKey (thePlayer, "enter", "down", policecarsChangeMarkerBindKeys) end end
-
You just copy and paste from some random script and think it'll work? nah, that's not how it works... also, you are messing client with server side.
-
You welcome, try to learn from your errors .
-
Dude... you had like 4 buttons in the same place! that way it was never going to work, but that wasn't the only error. GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Memo = {} function armyWindowCreate() guiSetVisible(GUIEditor_Window[1], false) GUIEditor_Window[2] = guiCreateWindow(409,90,101,298,"Army Rangers",false) GUIEditor_Button[6] = guiCreateButton(9,26,83,46,"Airforce",false,GUIEditor_Window[1]) GUIEditor_Button[7] = guiCreateButton(9,79,83,49,"Assault unit",false,GUIEditor_Window[1]) GUIEditor_Button[8] = guiCreateButton(9,134,83,49,"Special forces",false,GUIEditor_Window[1]) GUIEditor_Button[9] = guiCreateButton(9,188,83,45,"Recruit",false,GUIEditor_Window[1]) GUIEditor_Button[10] = guiCreateButton(9,244,83,43,"Back",false,GUIEditor_Window[1]) end function armyspawn() end function createthegui() GUIEditor_Window[1] = guiCreateWindow(307,67,288,305,"FARPG:Spawnmenu",false) GUIEditor_Button[1] = guiCreateButton(9,23,102,46,"Army Rangers...",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(9,79,104,41,"Police...",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(9,130,104,43,"Criminal...",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(9,185,104,44,"Civiillian...",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(9,237,104,43,"Admin...",false,GUIEditor_Window[1]) GUIEditor_Memo[1] = guiCreateMemo(142,29,132,44,"Army Rangers \nOnly",false,GUIEditor_Window[1]) GUIEditor_Memo[2] = guiCreateMemo(142,79,133,40,"Police Team",false,GUIEditor_Window[1]) GUIEditor_Memo[3] = guiCreateMemo(142,129,131,42,"For the badasses",false,GUIEditor_Window[1]) GUIEditor_Memo[4] = guiCreateMemo(143,179,129,41,"Peaceful way to\nEarn money",false,GUIEditor_Window[1]) GUIEditor_Memo[5] = guiCreateMemo(144,239,131,42,"Admin ONLY",false,GUIEditor_Window[1]) addEventHandler("onClientGUIClick", GUIEditor_Button[1], armyWindowCreate, false) -- you put armyWidnow, but is armyWindow. addEventHandler("onClientGUIClick", GUIEditor_Button[6], armyspawn, false) end
-
As I told you in the last PM I sent you about 30 seconds ago, you forgot the 'player' element, in your function you trigger 'client', but you never added such argument in the function.
-
So... you fixed it? if so, no need to make my head about to explode o_O.
-
GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Memo = {} function createthegui() GUIEditor_Window[1] = guiCreateWindow(307,67,288,305,"FARPG:Spawnmenu",false) GUIEditor_Button[1] = guiCreateButton(9,23,102,46,"Army Rangers...",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(9,79,104,41,"Police...",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(9,23,102,46,"Army Rangers...",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(9,23,102,46,"Army Rangers...",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(9,130,104,43,"Criminal...",false,GUIEditor_Window[1]) GUIEditor_Button[6] = guiCreateButton(9,185,104,44,"Civiillian...",false,GUIEditor_Window[1]) GUIEditor_Button[7] = guiCreateButton(9,237,104,43,"Admin...",false,GUIEditor_Window[1]) GUIEditor_Memo[1] = guiCreateMemo(142,29,132,44,"Army Rangers \nOnly",false,GUIEditor_Window[1]) GUIEditor_Memo[2] = guiCreateMemo(142,79,133,40,"Police Team",false,GUIEditor_Window[1]) GUIEditor_Memo[3] = guiCreateMemo(142,129,131,42,"For the badasses",false,GUIEditor_Window[1]) GUIEditor_Memo[4] = guiCreateMemo(143,179,129,41,"Peaceful way to\nEarn money",false,GUIEditor_Window[1]) GUIEditor_Memo[5] = guiCreateMemo(144,239,131,42,"Admin ONLY",false,GUIEditor_Window[1]) addEventHandler("onClientGUIClick", GUIEditor_Button[1], armyWindowCreate, false) -- you put armyWidnow, but is armyWindow. addEventHandler("onClientGUIClick", GUIEditor_Button[6], armyspawn, false) end function armyWindowCreate() guiSetVisible(GUIEditor_Window[1], false) GUIEditor_Window[2] = guiCreateWindow(409,90,101,298,"Army Rangers",false) GUIEditor_Button[1] = guiCreateButton(9,26,83,46,"Airforce",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(9,79,83,49,"Assault unit",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(9,134,83,49,"Special forces",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(9,188,83,45,"Recruit",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(9,244,83,43,"Back",false,GUIEditor_Window[1]) end
-
You are messing my head o_O, I don't understand anything now...
-
Uhm, you sent me a PM about this already, could you explain me what do you mean? I seriously don't understand.
-
Try something like this: dato = {} function cargarStats(usuario) local resultado = mysql_query(coneccion_mysql, "SELECT * FROM usuarios WHERE usuario='"..usuario.."'") if not dato[player] then dato[player] = {} end dato[player] = mysql_fetch_assoc(resultado) end Btw, what's that "player" there?
