-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
It's his tutorial, he can make it however he want's to.
-
Do that but don't use negative values as the size.
-
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)
-
Post your complete script, client side and server side.
-
That script is SERVER SIDE, not client side.
-
To show the country flag in the scoreboard you must the scoreboard himself, right now it just draw's texts.
-
No errors on debug? P.S: It loads the color when a map starts but not when you change the vehicle?
-
The script doesn't save the color, it'll load it. P.S: Is not the only thing I changed, are you blind?
-
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)
-
Everything there is wrong -__-, you can't just expect that every event handler will fit your needs.
-
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.
-
We don't give out scripts like that, we help you to seek/fix errors in your scripts.
-
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
-
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.
-
Deberian asignarse solas, si no, no tiene sentido. Para saber el ID creo que es: local id = exports["ids"]:getPlayerID(player)
-
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.
-
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.
-
Que puedo decir? nadie es perfecto.
-
Este recurso: https://community.multitheftauto.com/index.php?p= ... ls&id=2322 Es un sistema de ID's que yo sepa.
-
That script works perfectly fine in my server, maybe the marker position is wrong.
-
These errors doesn't come from this script.
-
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.
-
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
