-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
function repairVehicle ( thePlayer, commandName) -- never use a function name like fixVehicle because it can make problems. if ( isPedInVehicle ( thePlayer ) ) then local theVehicle = getPedOccupiedVehicle ( thePlayer) local succes = fixVehicle ( theVehicle ) if ( succes ) then outputChatBox (" Vehicle fixed. ", thePlayer ) else outputChatBox ( "Failed to fix your vehicle.", thePlayer) end else outputChatBox ( "You must be in a vehicle!", thePlayer ) end end addCommandHandler ( "vr", repairVehicle) I think this should work, it's defined as server side on meta.xml?
-
GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Grid = {} GUIEditor_Image = {} addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), function() bindKey ( "F6", "down", showMoneySend) end ) function showMoneySend () if ( guiGetVisible ( GUIEditor_Window[111] ) == false ) then showMoneySendStart() elseif ( guiGetVisible ( GUIEditor_Window[111]) == true ) then guiSetVisible ( GUIEditor_Window[111], false ) showCursor(false) end end function showMoneySendStart() showCursor(true) GUIEditor_Window[111] = guiCreateWindow(334,328,668,565,"Send Money Panel (F6 close/open )",false) --GUIEditor_Grid[111] = guiCreateGridList(35,74,222,443,false,GUIEditor_Window[111]) --guiGridListSetSelectionMode(playerList,2) --for i = 1, 1 do -- guiGridListAddRow(GUIEditor_Grid[111]) --end --guiGridListAddColumn(GUIEditor_Grid[111],"Players",0.9) GUIEditor_Edit[111] = guiCreateEdit(388,102,250,48,"",false,GUIEditor_Window[111]) GUIEditor_Label[111] = guiCreateLabel(305,109,72,36,"Player:",false,GUIEditor_Window[111]) guiLabelSetColor(GUIEditor_Label[111],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[111],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[111],"left",false) GUIEditor_Edit[112] = guiCreateEdit(389,185,248,50,"",false,GUIEditor_Window[111]) GUIEditor_Label[112] = guiCreateLabel(301,194,71,34,"Money:",false,GUIEditor_Window[111]) guiLabelSetColor(GUIEditor_Label[112],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[112],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[112],"left",false) GUIEditor_Image[111] = guiCreateStaticImage(389,396,246,160,"login/logo.png",false,GUIEditor_Window[111]) GUIEditor_Label[113] = guiCreateLabel(294,279,72,29,"Your money: $",false,GUIEditor_Window[111]) guiLabelSetColor(GUIEditor_Label[113],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[113],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[113],"left",false) GUIEditor_Button[111] = guiCreateButton(277,490,94,31,"Give!",false,GUIEditor_Window[111]) playersList = guiCreateGridList(35,74,222,443,false,GUIEditor_Window[111]) addEventHandler ( "onClientGUIClick", playersList, onClickPlayerList, false ) local columnplayersList = guiGridListAddColumn(playersList, "Players", 0.85) if (columnplayersList) then for id, playeritem in ipairs(getElementsByType("player")) do local rowplayersList = guiGridListAddRow(playersList) guiGridListSetItemText(playersList, rowplayersList, columnplayersList, getPlayerName(playeritem), false, false) end end end function onUpdateMoneyplayersList() guiGridListClear(playersList) for id, playeritem in ipairs (getElementsByType("player")) do local rowplayersList = guiGridListAddRow(playersList) guiGridListSetItemText(playersList, rowplayersList, 1, getPlayerName(playeritem), false, false) end end addEventHandler("onClientPlayerJoin", getRootElement(), onUpdateMoneyplayersList) addEventHandler("onClientPlayerQuit", getRootElement(), onUpdateMoneyplayersList) addEventHandler("onClientPlayerChangeNick", getRootElement(), onUpdateMoneyplayersList) function giveMoneySend ( ) edit1 = guiGetText ( GUIEditor_Edit[111] ) edit2 = guiGetText ( GUIEditor_Edit[112] ) triggerServerEvent ( "theMoney", getLocalPlayer(), edit1,edit2 ) end addEventHandler ( "onClientGUIClick", GUIEditor_Button[111], giveMoneySend, false ) --addEventHandler ( "onClientGUIClick", GUIEditor_Button[111], giveMoneySend ) --addEventHandler ( "onClientGUIClick", giveMoneySend, GUIEditor_Button[111], false ) function onClickPlayerList() if source == playersList then local playergrd = guiGridListGetItemText(playersList,guiGridListGetSelectedItem(playersList),1) guiSetText(GUIEditor_Edit[111],tostring(playergrd)) end end Now it's working fine (tested)
-
You copied parts of my code and failed function setCash ( sourcePlayer,givedname,amount) local gived = getPlayerFromName ( givedname ) if not isGuestAccount ( getPlayerAccount ( gived ) ) then account = getPlayerAccount(gived) local getPlayerCash = getAccountData ( account, "data.cash" ) setAccountData ( account, "data.cash", tonumber(getPlayerCash) + tonumber(amount) or 100 ) outputChatBox ( "Your cash has been setted.", gived ) outputChatBox ( "You've setted his cash.", sourcePlayer ) end end addCommandHandler ( "setcash", setCash ) Should work.
-
Post your FULL code here and i will try it at my private server.
-
Hmm, means the event handler is not added, doesn't it say bad argument or something at debug? addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), function() addEventHandler ( "onClientGUIClick", playersList, onClickPlayerList, false ) end ) function onClickPlayerList() if source == playersList then local playergrd = guiGridListGetItemText(playersList,guiGridListGetSelectedItem(playersList),1) guiSetText(GUIEditor_Edit[111],tostring(playergrd)) end end
-
It's the event even working? try adding an outputChatBox.
-
volk-rus, i already know that, but doesn't work with DX drawing P.S: I already said it's solved.
-
function onClickPlayerList() if source == playersList then local playergrd = guiGridListGetItemText(playersList,guiGridListGetSelectedItem(playersList),1) guiSetText(GUIEditor_Edit[111],tostring(playergrd)) end end addEventHandler ( "onClientGUIClick", playersList, onClickPlayerList, false ) Try it.
-
We don't accept any request, offer money and you may get a chance.
-
If i understand you right, you want the script to track players on that map table at area 51, if so download it at the mta community. link: https://community.multitheftauto.com/index.php?p= ... ls&id=1778
-
We don't accept request. what gamemode do you use? MTA paradise? because that one only allows Firstname Lastname.
-
I will test it later, right now i'am busy.
-
I'm afraid that nobody will do all that for just 40-80 USD, seriusly, when someone does all this he has to waste his personal time to do it, we don't have a program that does everything we tell him to do.
-
Ok, i fixed the missing ")" and now should work.
-
Easy o,O function onLoginSetCash ( ) if not isGuestAccount ( getPlayerAccount ( source ) ) then account = getPlayerAccount(source) if getAccountData ( account, "data.cash" ) then givePlayerMoney(source, tonumber(getAccountData(account,"data.cash"))) outputChatBox ( "You're cash is transfered back!", source ) else setAccountData( account, "data.cash", 0 ) outputChatBox ( "You're new and your cash will now be saved." ) end end end function onWastedSetCash ( ) if not isGuestAccount ( getPlayerAccount ( source ) ) then local getPlayerCash = getElementData ( source, "data.cash" ) setElementData ( source, "data.cash", getPlayerCash + 100 ) outputChatBox ( "You got 100$ for your death.", source ) end end function onQuitSaveCash() if not isGuestAccount ( getPlayerAccount ( source ) ) then account = getPlayerAccount(source) setAccountData(account,"data.cash",tonumber(getAccountData(account,"data.cash"))+tonumber(getPlayerMoney(source))) end end addEventHandler ( "onPlayerQuit", root, onQuitSaveCash ) function onLogoutSaveCash() if not isGuestAccount ( getPlayerAccount ( source ) ) then account = getPlayerAccount(source) setAccountData(account,"data.cash",tonumber(getAccountData(account,"data.cash"))+tonumber(getPlayerMoney(source))) setPlayerMoney(source,0) end end addEventHandler ( "onPlayerLogout", root, onLogoutSaveCash ) addEventHandler ( "onPlayerLogin", root, onLoginSetCash ) addEventHandler ( "onPlayerWasted", root, onWastedSetCash ) function myCash ( thePlayer ) if not isGuestAccount ( getPlayerAccount ( thePlayer ) ) then account = getPlayerAccount(thePlayer) local cash = getAccountData ( account, "data.cash" ) outputChatBox ( "Your cash is: " .. tostring ( cash ), thePlayer ) end end addCommandHandler ( "cash", myCash ) Try if it works (not tested)
-
I save them in account data or sqlite, i don't remember well.
-
I suposed i was understanding him wrongly
-
Using element data to save stuff? when you reconnect the data is lost o,O.
-
Let's get back on topic, how much are you willing to pay for all that stuff?
-
the last argument it's used to replay the sound already, no need to do a code for that.
-
You are insulting us Shayne, that's not a nice way of searching for an Scripter.
-
You could try open every garage, and when it opens the correct you will have the ID
-
function set ( ) selectedRow, selectedCol = guiGridListGetSelectedItem( mapGridList ) gridMapName = guiGridListGetItemText( mapGridList, selectedRow, selectedCol ) guiSetText ( mapNameEdit, tostring(gridMapName) ) end Try it.
-
CrazyDude, the problem is already done by his way, no need to change again.
