Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Castillo

    HELPP!!

    Yes, it'll work too.
  2. It's his tutorial, he can make it however he want's to.
  3. Do that but don't use negative values as the size.
  4. That's the full client side?? that's useless, the whole script is SERVER SIDE. I don't even know why you was triggering to the client side, it's just USELESS. function colorHandler ( thePlayer, commandName, r, g, b ) if (not isPedInVehicle(thePlayer)) then outputChatBox("[Error]: This command only works when you're in a vehicle", thePlayer, 255, 0, 0, true) return end if (tonumber(r) and tonumber(g) and tonumber(b)) then local playerVehicle = getPedOccupiedVehicle(thePlayer) local account = getPlayerAccount(thePlayer) if (getPlayerMoney(thePlayer) >= 10000) then takePlayerMoney(thePlayer, 10000) playSoundFrontEnd(thePlayer, 46) setVehicleColor(playerVehicle, tonumber(r), tonumber(g), tonumber(b)) setAccountData(account, "color.data", toJSON({r, g, b})) outputChatBox("#2E9AFE[shop]: #FFFFFF" ..getPlayerName(thePlayer).. "#2E9AFE has bought vehicle colors for 10000$. (/bc)", root, 255, 255, 255, true) else outputChatBox("[Error]: You don't have enough money to buy.", thePlayer, 255, 0, 0, true) end else outputChatBox("[Error]: Syntax: /bc [r g b]", thePlayer, 255,0 ,0, true) end end addCommandHandler("bc", colorHandler) function loadVehicleColor ( thePlayer ) local account = getPlayerAccount(thePlayer) local pColor = getAccountData(account, "color.data") if (pColor) then local r, g, b = unpack(fromJSON(pColor)) local playerVehicle = getPedOccupiedVehicle(thePlayer) if (playerVehicle) then setVehicleColor(playerVehicle, tonumber(r), tonumber(g), tonumber(b)) end end end addEventHandler("onPlayerLogin", getRootElement(), function () loadVehicleColor(source) end) addEventHandler("onPlayerWasted", getRootElement(), function () loadVehicleColor(source) end) addEventHandler("onPlayerPickUpRacePickUp", getRootElement(), function (pickupID, pickupType, vehicleModel) if (pickupType == "vehiclechange") then loadVehicleColor(source) end end) addEventHandler("onVehicleEnter", getRootElement(), function (thePlayer) loadVehicleColor(thePlayer) end)
  5. Post your complete script, client side and server side.
  6. That script is SERVER SIDE, not client side.
  7. To show the country flag in the scoreboard you must the scoreboard himself, right now it just draw's texts.
  8. No errors on debug? P.S: It loads the color when a map starts but not when you change the vehicle?
  9. The script doesn't save the color, it'll load it. P.S: Is not the only thing I changed, are you blind?
  10. Try this: function loadVehicleColor ( thePlayer ) local account = getPlayerAccount(thePlayer) local pColor = getAccountData(account, "color.data") if (pColor) then local r, g, b = unpack(fromJSON(pColor)) triggerClientEvent(thePlayer,"colorv", thePlayer, "",r,g,b) local playerVehicle = getPedOccupiedVehicle(thePlayer) if (playerVehicle) then setVehicleColor(playerVehicle, tonumber(r), tonumber(g), tonumber(b)) end end end addEventHandler("onPlayerLogin", getRootElement(), function () loadVehicleColor(source) end) addEventHandler("onPlayerWasted", getRootElement(), function () loadVehicleColor(source) end) addEventHandler("onPlayerPickUpRacePickUp", getRootElement(), function (pickupID, pickupType, vehicleModel) if (pickupType == "vehiclechange") then loadVehicleColor(source) end end) addEventHandler("onVehicleEnter", getRootElement(), function (thePlayer) loadVehicleColor(thePlayer) end)
  11. Everything there is wrong -__-, you can't just expect that every event handler will fit your needs.
  12. The player element of the wasted player triggered by "onPlayerWasted" is 'source'. Use: "onPlayerPickUpRacePickup" -> Check if the pickup type is "vehiclechange". And "onVehicleEnter" for when the map starts.
  13. We don't give out scripts like that, we help you to seek/fix errors in your scripts.
  14. There are many anti AFK resources in the MTA community, you should search before ask. https://community.multitheftauto.com/index.php?p= ... ls&id=1069 https://community.multitheftauto.com/index.php?p= ... ls&id=3114
  15. What do you mean by edit the role once? you can query as many times as you want. P.S: That script will just ADD a new value to the table, it won't update an already existing value.
  16. Deberian asignarse solas, si no, no tiene sentido. Para saber el ID creo que es: local id = exports["ids"]:getPlayerID(player)
  17. function getan() call(getResourceFromName("dxscoreboard"), "addScoreboardColumn", "Role", getRootElement(), 8, 0.07) executeSQLCreateTable("Roles", "Username STRING, Role STRING" ) end addEventHandler ( "onResourceStart", resourceRoot, getan ) function addUserIfNotExists(username, role) local checkUser = executeSQLSelect ( "Roles", "Username", "Username = '" .. tostring(username) .. "'" ) if ( type( checkUser ) == "table" and #checkUser == 0 or not checkUser ) then return executeSQLInsert ( "Roles", "'".. tostring(username) .."','".. tostring(role) .."'" ) end end function getAccountRole(username) local checkUser = executeSQLSelect ( "Roles", "*", "Username = '" .. tostring(username) .. "'" ) if ( type( checkUser ) == "table" and #checkUser == 0 or not checkUser ) then return "None" else return tostring(checkUser[1]["Role"]) end end addCommandHandler("addrole", function (thePlayer, cmd, username, role) if addUserIfNotExists(username, role) then outputChatBox("/addrole : Added Username: ".. tostring(username) ..", Role: ".. tostring(role) ..".",thePlayer,0,255,0) end end) addEventHandler("onPlayerLogin",root, function (_,account) local accountName = getAccountName(account) local role = getAccountRole(accountName) setElementData(source,"Role",role) end) The table couldn't be created because of the "-" in it's name.
  18. You're using account names or player names? if player names, then that's really useless, because most of the players keeps changing their nick constantly.
  19. Castillo

    Me cansé

    Que puedo decir? nadie es perfecto.
  20. Este recurso: https://community.multitheftauto.com/index.php?p= ... ls&id=2322 Es un sistema de ID's que yo sepa.
  21. Castillo

    Help please..

    That script works perfectly fine in my server, maybe the marker position is wrong.
  22. Castillo

    Help please..

    These errors doesn't come from this script.
  23. There's no such function: createColShape, myonlake. Maybe you meant: createColTube? P.S: You're creating a colshape every time he writes the command, without destroying it.
  24. Castillo

    Help please..

    The error is "bad argument @ setElementVelocity"? if so: Me = getLocalPlayer() local screenWidth, screenHeight = guiGetScreenSize() function Main () marker1 = createMarker(3236.3000488281, -266.20001220703, 16, "corona", 80, 0, 0, 0, 0) addEventHandler ( "onClientMarkerHit", getRootElement(), MainFunction ) end addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), Main ) function MainFunction ( hitPlayer, matchingDimension ) if (hitPlayer ~= Me) then return end if (not isPedInVehicle(hitPlayer)) then return end local vehicle = getPedOccupiedVehicle ( hitPlayer ) if source == marker1 then setElementVelocity(vehicle, 0.0, 0.2, 2) end end
×
×
  • Create New...