-
Posts
748 -
Joined
-
Last visited
Everything posted by AMARANT
-
В какой "тием"? В какой команде ты умер в такой и заспавнишься. Команда меняется только если ты ее меняешь скриптово или отключаешь ресурс где создавались эти команды.
-
function sod ( ) spawnPlayer ( source, 1200, -1400, 13) outputChatBox ( "Welcome to M.F.A", source, 255, 0, 0 ) end addEventHandler ( "onPlayerWasted", getRootElement(), sod )
-
He probably wants the example right here on this topic.
-
debugscript is a good thing
-
createTeam is server-side function only.
-
local myMarker=createMarker(1200,-1400,13,"cylinder",3,255,0,0,125) function VehicleHit(hitElement,matchingDimension) if getElementType(hitElement)=="vehicle" then outputChatBox(getVehicleName(hitElement).." hit my marker!",getRootElement(),255,0,0) end end addEventHandler("onMarkerHit",myMarker,VehicleHit)
-
guiSetProperty ( bEditChar, "NormalTextColour", "FF00FF00" ) -- Normal state guiSetProperty ( bEditChar, "PushedTextColour", "FF00FF00" ) -- Pushed guiSetProperty ( bEditChar, "DisabledTextColour", "FF00FF00" ) -- Disabled guiSetProperty ( bEditChar, "HoverTextColour", "FF00FF00" ) -- Hovered
-
https://wiki.multitheftauto.com/wiki/GuiLabelSetColor https://wiki.multitheftauto.com/wiki/GuiSetProperty
-
You was given the code example and there is a resource that has a feature you want. Don't be lazy and do something with it instead of waiting for someone who makes the whole script for you.
-
This script is exactly the thing you need. You can check the code especially as because it has lines with comments.
-
function mrkMakeDrug(hitElement,matchingDimension) if getElementType(hitElement)=="player" and matchingDimension then triggerClientEvent("mrkMakeDrugC",hitElement) end end addEventHandler("onMarkerHit", mrkMakeDrug1, mrkMakeDrug)
-
There's a nice script which can help you in the beginning until you learn how to make your own. https://community.multitheftauto.com/index.php?p=resources&s=details&id=292
-
Where is your GUI element 'guiMakingDrugs' created? And again any errors in the console, debugscript 3?
-
Are you trying to create ped in bar or where? To create it in some interior you have to set it for element with function: setElementInterior
-
Maybe it's because of wrong dimension or unspecified interior?
-
That means that you are not admin and have no right for this command. But anyway debugscript won't help you because your code is not client-side. I suppose you can't get a result in your function because of connection value returns false. In order to open a query to database you have to start a connection with it.
-
setTimer(myFunction,1000,0) function myFunction() outputChatBox("!") end
-
Just save your drugs data via setElementData function and set it into account with onPlayerQuit server-side event.
-
Now I've finally noticed what is your problem. "onClientPlayerQuit" doesn't pass the data to the server because the local player is already went offline. I don't recommend using this function. You have to find another way to save your data or use server-side analog of this function.
-
Ohh and change 'player' value in that function to 'source'. I marked it with a comment in the post above.
-
Your data wasn't saved. Have you done what I told you in my previous posts? I mean removing unnecessary getLocalPlayer() from client-side trigger event? If you have then try to check what data passes to the server by another debug message: addEvent("saveDrugAmount",true) addEventHandler("saveDrugAmount",getRootElement(), function(amountCannabisS,amountHeroinS,amountCocaineS,amountLSDS,amountEcstasyS,amountOpiumS) -- Removed 'player' from arguments playeraccount = getPlayerAccount(source) -- Here was 'player' if (playeraccount) then setAccountData(playeraccount,"amountCannabis",tonumber(amountCannabisS)) setAccountData(playeraccount,"amountHeroin",tonumber(amountHeroinS)) setAccountData(playeraccount,"amountCocaine",tonumber(amountCocaineS)) setAccountData(playeraccount,"amountLSDS",tonumber(amountLSDS)) setAccountData(playeraccount,"amountEcstasy",tonumber(amountEcstasyS)) setAccountData(playeraccount,"amountOpium",tonumber(amountOpiumS)) outputChatBox(tostring(amountCannabisS)..", "..tostring(amountHeroinS)..", "..tostring(amountCocaineS)..", "..tostring(amountLSDS)..", "..tostring(amountEcstasyS)..", "..tostring(amountOpiumS)) end end)
-
In-game by debug messages or check internal.db by opening it and see for yourself the data. Try to put debug message in this part of the code: amountCannabis2 = getAccountData(playeraccount,"amountCannabis") amountHeroin2 = getAccountData(playeraccount,"amountHeroin") amountCocaine2 = getAccountData(playeraccount,"amountCocaine") amountLSD2 = getAccountData(playeraccount,"amountLSDS") amountEcstasy2 = getAccountData(playeraccount,"amountEcstasy") amountOpium2 = getAccountData(playeraccount,"amountOpium") outputChatBox(tostring(amountCannabis2)..", "..tostring(amountHeroin2)..", "..tostring(amountCocaine2)..", "..tostring(amountLSD2)..", "..tostring(amountEcstasy2)..", "..tostring(amountOpium2))