Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. You can set the streaming method to 2 in the meta.xml, that'll make them spawn only via spawnpoints set on a map file. Example of spawn point: "Zombie_spawn (1)" interior="0" posX="0" posY="0" posZ="2" rotX="0" rotY="0" rotZ="0" /> About the map image, I guess you mean the one you have in F1 to set your position, if so, just edit the PNG file and restart the resource. About F11 one, well, that's different. I think one of these resources: https://community.multitheftauto.com/index.php?p= ... ils&id=381 https://community.multitheftauto.com/index.php?p= ... ils&id=382 can change the F11 map.
  2. Example: myGUIButton = guiCreateButton(arguments...)
  3. Castillo

    elementData

    You can't store a Lua-table into account data or (My)SQL, but you can store a JSON string which works pretty much like a table.
  4. Nice one, good luck with it .
  5. Castillo

    elementData

    The wiki explains all what you need to know about it. P.S: The script should work without any change.
  6. Castillo

    elementData

    You're messing client side with server side. I would use client side XML to save the color, but well, if you want it account data based, here it is: -- client side: addEventHandler("onClientResourceStart",resourceRoot, function() nitroShader = dxCreateShader("nitro.fx") end) -- This function will set the new color of the nitro function updateNitroColor(r,g,b) if nitroShader then if r and g and b then engineApplyShaderToWorldTexture (nitroShader,"smoke") dxSetShaderValue (nitroShader, "gNitroColor", r/255, g/255, b/255 ) end end end -- This function will reset the nitro back to the original function resetNitroColor() if nitroShader then engineRemoveShaderFromWorldTexture(nitroShader,"smoke") end end function setNitroColor(command,r,g,b) if (r and g and b) then local r,g,b = tonumber(r),tonumber(g),tonumber(b) if (r <= 255 and g <= 255 and b <= 255) then updateNitroColor(r,g,b) setElementData(localPlayer,"nitroColor",{r, g, b}) outputChatBox("Nitro color updated!",255,255,255,true) else outputChatBox("Colors must be between 0 and 255",255,255,255,true) end else resetNitroColor() outputChatBox("Nitro color reset to original!",255,255,255,true) end end addCommandHandler("nitro",setNitroColor) addEvent("setNitroColor",true) addEventHandler("setNitroColor",root,setNitroColor) -- server side: function onPlayerQuit (playerSource) local acc = getPlayerAccount(playerSource) local playerVehicle = getOccupiedVehicle(playerSource) if (not isGuestAccount(acc) and playerVehicle) then local nitroColor = getElementData(playerSource, "nitroColor") if (nitroColor) then setAccountData(acc, "nitro.data", toJSON({unpack(nitroColor)})) end end end addEventHandler("onPlayerQuit", root, onPlayerQuit) function onPlayerLogin (_,acc) local pNitro = getAccountData(acc, "nitro.data") if (pNitro) then local color = getAccountData(acc,"nitro.data") local r, g, b = unpack(fromJSON(color)) triggerClientEvent(source,"setNitroColor",source,"",r,g,b) end end addEventHandler("onPlayerLogin", root, onPlayerLogin)
  7. But is working or not? because that wouldn't make any effect.
  8. Is that hard to see how the other groups are created and create new ones?
  9. Nah, as far as I know it's just to keep your script organized . Maybe I'm wrong too . So, the script does work now? I didn't touch anything as far as I know, so if it does now, why it didn't do before?
  10. I suggest using guieditor resource to design your GUI interfaces: https://community.multitheftauto.com/index.php?p= ... ils&id=141 And then you can add an event handler in your script, like this: addEventHandler("onClientGUIClick",myGUIButton, function () guiSetVisible(myGUIWindow, false) showCursor(false) end, false)
  11. Do you mean ACL based (access control list)? if so read here: https://wiki.multitheftauto.com/wiki/ACL
  12. The server manual includes that, read after: "Adding administrators".
  13. That means that you're not an admin.. Did you add your account to the "Admin" group in the acl.xml?
  14. Did you refresh the resources? by typing "refresh" in the Server console (black window) or "/refresh" in-game.
  15. I'd this: idtable = {} for x=1, 200 do idtable[x]=0 end function givePlayerID(player) local id = 1 local check = false for i, v in ipairs(idtable) do if ( v==0 and check==false ) then id=i check=true end end idtable[id]=id outputChatBox(tostring(id) ..": ".. tostring(idtable[id])) setElementData(player,"player.id",id) for i, v in ipairs(idtable) do outputChatBox(tostring(v)) end end addCommandHandler("id",givePlayerID) And it returns like this: 1: 1, it doesn't return 0.
  16. Well, you can re-order the ID's after someone quits.
  17. Si el trabajo se trata de markers, blips te sugiero que si. Esto se podria hacer todo server side tambien, pero seria mas dificl.
  18. It'll count the table items. P.S: It's "tell me" .
  19. I'm not sure but, does hamachi servers appear on server list? I think they don't.
  20. I don't get what do you mean, that works just fine. P.S: Your script doesn't really make sense to me.
  21. Well, you can remove the ID when the player leaves, right? addEventHandler("onPlayerQuit",root, function () local id = getElementData(source, "player.id") if (tonumber(id)) then if (idtable[id]) then table.remove(idtable, id) end end end)
  22. You want to set a ID like this: First player: ID 1 Second player: ID 2 Etc, etc? if so, this should work: idtable = {} function givePlayerID(player) local id = #idtable +1 table.insert(idtable, id) setElementData(player,"player.id",id) end
  23. That's a mess.. -- client side. local player = nil function thePlayerReachedHunter() if (player) then dxDrawText("The player ".. tostring(getPlayerName(player)) .." got hunter! NOW RUN !",155.0,549.0,669.0,591.0,tocolor(255,255,255,255),1.0,"diploma","left","top",false,false,false) end end addEvent("disableGhostMode",true) addEventHandler("disableGhostMode",root, function (thePlayer) player = thePlayer outputChatBox ( "#FFE303The ghostmode will be disabled in 5 seconds ",255,255,255 ,true ) addEventHandler ( "onClientRender", root, thePlayerReachedHunter ) setTimer(function () removeEventHandler ( "onClientRender", root, thePlayerReachedHunter ) end, 5000, 1) setTimer(function () for k,v in ipairs(getElementsByType("vehicle")) do setElementCollidableWith(v, v, false) end end, 5000, 1) end -- server side: function someoneReachedHunter(number, sort, model) if (sort == "vehiclechange" and model == 425) then triggerClientEvent("disableGhostMode",getRootElement(),source) end end addEvent("onPlayerPickUpRacePickup",true) addEventHandler("onPlayerPickUpRacePickup",getRootElement(),someoneReachedHunter)
×
×
  • Create New...