Agon
Members-
Posts
151 -
Joined
-
Last visited
Everything posted by Agon
-
I know and i've created the xml files (not with createXML function) but i don't know how to import that files when i click the items on gridlist...
-
local myFiles = { ["Destruction Zones"] = "destruction.xml", ["Environment"] = "env.xml", ["Ferris Wheel"] = "ferris.xml", ["HeadQuarters"] = "hq.xml", ["Horseshoe Mission"] = "horseshoe.xml", ["Shops"] = "shops.xml", ["Skins"] = "skins.xml", ["UFO"] = "ufo.xml", ["Vehicles"] = "veh.xml", ["Weapons"] = "weap.xml", ["Weed Mission"] = "weed.xml", } function myHelpList(key, keyState) helpWindow = guiCreateWindow(0.1768,0.2188,0.6475,0.6641,"Help Window",true) guiSetAlpha(helpWindow,1) guiWindowSetSizable(helpWindow,false) closeButton = guiCreateButton(0.3725,0.8922,0.2398,0.0784,"Close",true,helpWindow) guiSetFont(closeButton,"default-bold-small") helpEdit = guiCreateEdit(0.2247,0.1471,0.7225,0.7137,"",true,helpWindow) guiEditSetReadOnly( helpEdit, true ) helpGrid = guiCreateGridList(0.0136,0.1451,0.1961,0.7157,true,helpWindow) guiGridListSetSelectionMode(helpGrid,2) guiGridListAddColumn(helpGrid,"Freeroam",0.2) destructionZones = guiGridListAddRow(helpGrid) environment = guiGridListAddRow(helpGrid) ferrisWheel = guiGridListAddRow(helpGrid) headQuarters = guiGridListAddRow(helpGrid) horseshoeMission = guiGridListAddRow(helpGrid) shops = guiGridListAddRow(helpGrid) skins = guiGridListAddRow(helpGrid) ufo = guiGridListAddRow(helpGrid) vehicles = guiGridListAddRow(helpGrid) weapons = guiGridListAddRow(helpGrid) weedMission = guiGridListAddRow(helpGrid) guiGridListSetItemText(helpGrid, destructionZones, Freeroam, "Destruction Zones") guiGridListSetItemText(helpGrid, environment, Freeroam, "Environment") guiGridListSetItemText(helpGrid, ferrisWheel, Freeroam, "Ferris Wheel") guiGridListSetItemText(helpGrid, headQuarters, Freeroam, "HeadQuarters") guiGridListSetItemText(helpGrid, horseshoeMission, Freeroam, "Horseshoe Mission") guiGridListSetItemText(helpGrid, shops, Freeroam, "Shops") guiGridListSetItemText(helpGrid, skins, Freeroam, "Skins") guiGridListSetItemText(helpGrid, ufo, Freeroam, "UFO") guiGridListSetItemText(helpGrid, vehicles, Freeroam, "Vehicles") guiGridListSetItemText(helpGrid, weapons, Freeroam, "Weapons") guiGridListSetItemText(helpGrid, weedMission, Freeroam, "Weed Mission") end addCommandHandler("help", myHelpList) bindKey("F9", "down", myHelpList) So how will i able to load xml files? https://wiki.multitheftauto.com/wiki/XmlLoadFile will this load the xml files into helpEdit?
-
where is the download link btw?
-
I have 11 xml files (destructionzones.xml, environment.xml, ferriswheel.xml, headquarters.xml ......) but i don't know how to add them when i click on the row. should I make 11 functions like "if guiGridListGetSelectedItem(environment) then loadXML("environment.xml")" for all rows? function myHelpList(key, keyState) helpWindow = guiCreateWindow(0.1768,0.2188,0.6475,0.6641,"Help Window",true) guiSetAlpha(helpWindow,1) guiWindowSetSizable(helpWindow,false) closeButton = guiCreateButton(0.3725,0.8922,0.2398,0.0784,"Close",true,helpWindow) guiSetFont(closeButton,"default-bold-small") helpMemo = guiCreateMemo(0.2247,0.1471,0.7225,0.7137,"",true,helpWindow) helpGrid = guiCreateGridList(0.0136,0.1451,0.1961,0.7157,true,helpWindow) guiGridListSetSelectionMode(helpGrid,2) guiGridListAddColumn(helpGrid,"Freeroam",0.2) for i = 1, 11 do guiGridListAddRow(helpGrid) end guiGridListSetItemText(helpGrid,0,1,"Destruction Zones") guiGridListSetItemText(helpGrid,1,1,"Environment") guiGridListSetItemText(helpGrid,2,1,"Ferris Wheel") guiGridListSetItemText(helpGrid,3,1,"HeadQuarters") guiGridListSetItemText(helpGrid,4,1,"Horseshoe Mission") guiGridListSetItemText(helpGrid,5,1,"Shops") guiGridListSetItemText(helpGrid,6,1,"Skins") guiGridListSetItemText(helpGrid,7,1,"UFO") guiGridListSetItemText(helpGrid,8,1,"Vehicles") guiGridListSetItemText(helpGrid,9,1,"Weapons") guiGridListSetItemText(helpGrid,10,1,"Weed Mission") end addCommandHandler("help", myHelpList) bindKey("F9", "down", myHelpList)
-
What is difference between using MySQL and player account in order to save player data?
-
function ticketSystem(source) takePlayerMoney(source, 1000) -- 1000$ you can change it.. outputChatBox(getPlayerFromName(source) .. "bought a ticket!", getRootElement(), 0, 255, 0, true) end addCommandHandler("ticket", ticketSystem)
-
He draws hud but when you die, 2 hud appears (one of them is gta's original hud and the other is his hud i think.)
-
addCommandHandler https://wiki.multitheftauto.com/wiki/Scr ... troduction try to figure it out...
-
dude don't copy all the code... just try to understand it..
-
any idea how to fix that? it won't make me register..
-
because if i don't delete the window, the register window will appear on login window..
-
ok everything is fine. when i click login, it logs me in. but when i click register, a new window appears and when i try to register, it gives error: line 66: bad argument @ addEventHandler [expected element at argument 2, got nil]
-
line 80: bad argument @ addEventHandler [expected element at argument 2, got nil] line 81: bad argument @ addEventHandler [expected element at argument 2, got nil] line 82: bad argument @ addEventHandler [expected element at argument 2, got nil] I checked wiki and it's ok for me but it gives errors function loginRegisterWindow() login_Window = guiCreateWindow(0.3252,0.3138,0.3428,0.276,"Login Window",true) guiSetAlpha(login_Window,1) guiWindowSetMovable(login_Window,false) guiWindowSetSizable(login_Window,false) loginNick_Edit = guiCreateEdit(0.0627,0.3632,0.8946,0.1415,"",true,login_Window) loginPw_Edit = guiCreateEdit(0.0598,0.6509,0.8946,0.1415,"",true,login_Window) guiEditSetMasked(loginPw_Edit,true) username_Label = guiCreateLabel(0.0769,0.2547,0.8462,0.1038," Username",true,login_Window) guiSetFont(username_Label,"default-bold-small") password_Label = guiCreateLabel(0.0769,0.533,0.8462,0.1038," Password",true,login_Window) guiSetFont(password_Label,"default-bold-small") loginOrRegister_Label = guiCreateLabel(0.0769,0.1179,0.8462,0.1038," Login or Register",true,login_Window) guiSetFont(loginOrRegister_Label,"default-bold-small") login_Button = guiCreateButton(0.0285,0.8491,0.3561,0.1085,"Login",true,login_Window) guiSetFont(login_Button,"default-bold-small") register_Button = guiCreateButton(0.6182,0.8443,0.3561,0.1085,"Register",true,login_Window) guiSetFont(register_Button,"default-bold-small") showCursor (true) end addEventHandler("onPlayerJoin",resourceRoot, loginRegisterWindow) function loginWindowHandler( ) local playerName = getPlayerName(getLocalPlayer()) guiSetText(loginNick_Edit, "") guiSetText(loginNick_Edit, playername) guiSetInputEnabled(true) showCursor ( true ) end function onClickLogin ( button, state ) if (source == login_Button) then triggerServerEvent ( "onLogin", getRootElement(), getLocalPlayer(), guiGetText(loginNick_Edit), guiGetText(loginPw_Edit) ) end end function onClickRegister ( button, state ) if (source == register_Button) then destroyElement(login_Window, true) register_Window = guiCreateWindow(0.3252,0.3138,0.3428,0.276,"Register Window",true) guiSetAlpha(register_Window,1) guiWindowSetMovable(register_Window,false) guiWindowSetSizable(register_Window,false) registerNick_Edit = guiCreateEdit(0.0627,0.3632,0.8946,0.1415,"",true,register_Window) registerPw_Edit = guiCreateEdit(0.0598,0.6509,0.8946,0.1415,"",true,register_Window) guiEditSetMasked(registerPw_Edit,true) registerUsername_Label = guiCreateLabel(0.0769,0.2547,0.8462,0.1038," Username",true,register_Window) guiSetFont(registerUsername_Label,"default-bold-small") registerPassword_Label = guiCreateLabel(0.0769,0.533,0.8462,0.1038," Password",true,register_Window) guiSetFont(registerPassword_Label,"default-bold-small") loginOrRegister_Label2 = guiCreateLabel(0.0769,0.1179,0.8462,0.1038," Login or Register",true,register_Window) guiSetFont(loginOrRegister2_Label,"default-bold-small") register_Button2 = guiCreateButton(0.6182,0.8443,0.3561,0.1085,"Register",true,register_Window) guiSetFont(register_Button2,"default-bold-small") end end function onClickRegister2 ( button, state ) if (source == register_Button2) then triggerServerEvent ( "onRegister", getRootElement(), getLocalPlayer(), guiGetText(registerNick_Edit), guiGetText(registerPw_Edit)) end end function hideLoginWindow() guiSetInputEnabled(false) guiSetVisible ( login_Window, false ) showCursor ( false ) end addEvent( "hideLoginWindow", true ) addEventHandler( "hideLoginWindow", getRootElement(), hideLoginWindow ) function hideRegisterWindow() guiSetInputEnabled(false) guiSetVisible ( register_Window, false ) showCursor ( false ) end addEvent( "hideRegisterWindow", true ) addEventHandler( "hideRegisterWindow", getRootElement(), hideRegisterWindow ) addEventHandler ( "onClientGUIClick", login_Button, onClickLogin ) addEventHandler ( "onClientGUIClick", register_Button, onClickRegister ) addEventHandler ( "onClientGUIClick", register_Button2, onClickRegister2 )
-
omg how could i miss this? thank you so much
-
Why do you want people to make scripts for you? You should show your scripts and scripters will correct it.. Anyway, use these commands: createTeam() setPlayerTeam() getPlayerTeam() addCommandHandler -- etc. etc.
-
line:2 bad argument @getPlayerAccount [expected element at argument 1, got nil] idk what's wrong with that i wanted to save skin when players type /skinsave function changeTheSkin() local playerAccount = getPlayerAccount(source) if playerAccount then local playerSkin = getElementModel(source) for i = 0,17 do local arg1,arg2 = getPedClothes( source, i ) setAccountData( playerAccount, "player.clothes."..tostring( i ),tostring( arg1 )..","..tostring( arg2 ) ) end setAccountData( playerAccount, "player.skin", playerSkin ) outputChatBox("#FF0000*INFO: #0095FFYour skin was successfully saved!", 0, 255, 0) end end addCommandHandler( "skinsave", changeTheSkin) addEventHandler( "onPlayerLogin", root, function( ) local playerAccount = getPlayerAccount( source ) if playerAccount then local playerSkin = getAccountData( playerAccount, "player.skin" ) if playerSkin then setElementModel( source, playerSkin ) for i = 0,17 do local acc = getAccountData( playerAccount, 'player.clothes.'..i ) if not acc:find 'false' then addPedClothes( source,acc:sub( 1,acc:find( ',' ) - 1 ),acc:sub( acc:find( ',' ) + 1,acc:len( ) ),i ) end end end end end )
-
Thank you it works but can you explain what they are: for i = 0,17 do -- is it a table? local arg1,arg2 = getPedClothes( source, i ) setAccountData( playerAccount, "player.clothes."..tostring( i ),tostring( arg1 )..","..tostring( arg2 ) ) -- what is tostring for? for i = 0,17 do local acc = getAccountData( playerAccount, 'player.clothes.'..i ) if not acc:find 'false' then -- does that check if player has clothes on it? addPedClothes( source,acc:sub( 1,acc:find( ',' ) - 1 ),acc:sub( acc:find( ',' ) + 1,acc:len( ) ),i ) -- and this is very confusing Thank you again
-
Hi. I made this script with some help of the wiki but it doesn't save my cj's clothes. it says bad argument @addPedClothes. i know i have to use this: addPedClothes(source, "clothesTexture", "clothesModel", playerShirt) --- if i use this it won't add clothes i think. Please help me with this function playerLeave() local playerAccount = getPlayerAccount(source) if (playerAccount) then local playerMoney = getPlayerMoney(source) local playerSkin = getElementModel(source) local playerShirt = getPedClothes(source, 0) local playerHead = getPedClothes(source, 1) local playerTrousers = getPedClothes(source, 2) local playerShoes = getPedClothes(source, 3) local playerTattoosLeftUpperArm = getPedClothes(source, 4) local playerTattoosLeftLowerArm = getPedClothes(source, 5) local playerTattoosRightUpperArm = getPedClothes(source, 6) local playerTattoosRightLowerArm = getPedClothes(source, 7) local playerTattoosBack = getPedClothes(source, 8 ) local playerTattoosLeftChest = getPedClothes(source, 9) local playerTattoosRightChest = getPedClothes(source, 10) local playerTattoosStomach = getPedClothes(source, 11) local playerTattoosLowerBack = getPedClothes(source, 12) local playerNecklace = getPedClothes(source, 13) local playerWatch = getPedClothes(source, 14) local playerGlasses = getPedClothes(source, 15) local playerHat = getPedClothes(source, 16) local playerExtra = getPedClothes(source, 17) setAccountData(playerAccount, "player.money", playerMoney) setAccountData(playerAccount, "player.skin", playerSkin) setAccountData(playerAccount, "player.shirt", playerShirt) setAccountData(playerAccount, "player.head", playerHead) setAccountData(playerAccount, "player.trousers", playerTrousers) setAccountData(playerAccount, "player.shoes", playerShoes) setAccountData(playerAccount, "player.tattoosLeftUpperArm", playerTattoosLeftUpperArm) setAccountData(playerAccount, "player.tattoosLeftLowerArm", playerTattoosLeftLowerArm) setAccountData(playerAccount, "player.tattoosRightUpperArm", playerTattoosRightUpperArm) setAccountData(playerAccount, "player.tattoosRightLowerArm", playerTattoosRightLowerArm) setAccountData(playerAccount, "player.tattoosBack", playerTattoosBack) setAccountData(playerAccount, "player.tattoosLeftChest", playerTattoosLeftChest) setAccountData(playerAccount, "player.tattoosRightChest", playerTattoosRightChest) setAccountData(playerAccount, "player.tattoosStomach", playerTattoosStomach) setAccountData(playerAccount, "player.tattoosLowerBack", playerTattoosLowerBack) setAccountData(playerAccount, "player.necklace", playerNecklace) setAccountData(playerAccount, "player.watch", playerWatch) setAccountData(playerAccount, "player.glasses", playerGlasses) setAccountData(playerAccount, "player.hat", playerHat) setAccountData(playerAccount, "player.extra", playerExtra) end end addEventHandler("onPlayerQuit", getRootElement(), playerLeave) function playerLogin() local playerAccount = getPlayerAccount(source) if (playerAccount) then local playerMoney = getAccountData(playerAccount, "player.money") local playerSkin = getAccountData(playerAccount, "player.skin") local playerShirt = getAccountData(playerAccount, "player.shirt") local playerHead = getAccountData(playerAccount, "player.head") local playerTrousers = getAccountData(playerAccount, "player.trousers") local playerShoes = getAccountData(playerAccount, "player.shoes") local playerTattoosLeftUpperArm = getAccountData(playerAccount, "player.tattoosLeftUpperArm") local playerTattoosLeftLowerArm = getAccountData(playerAccount, "player.tattoosLeftLowerArm") local playerTattoosRightUpperArm = getAccountData(playerAccount, "player.tattoosRightUpperArm") local playerTattoosRightLowerArm = getAccountData(playerAccount, "player.tattoosRightLowerArm") local playerTattoosBack = getAccountData(playerAccount, "player.tattoosBack") local playerTattoosLeftChest = getAccountData(playerAccount, "player.tattoosLeftChest") local playerTattoosRightChest = getAccountData(playerAccount, "player.tattoosRightChest") local playerTattoosStomach = getAccountData(playerAccount, "player.tattoosStomach") local playerTattoosLowerBack = getAccountData(playerAccount, "player.tattoosLowerBack") local playerNecklace = getAccountData(playerAccount, "player.necklace") local playerWatch = getAccountData(playerAccount, "player.watch") local playerGlasses = getAccountData(playerAccount, "player.glasses") local playerHat = getAccountData(playerAccount, "player.hat") local playerExtra = getAccountData(playerAccount, "player.extra") if (playerMoney) then setPlayerMoney(source, playerMoney) setElementModel(source, playerSkin) addPedClothes(source, playerShirt) addPedClothes(source, playerHead) addPedClothes(source, playerTrousers) addPedClothes(source, playerShoes) addPedClothes(source, playerTattoosLeftUpperArm) addPedClothes(source, playerTattoosLeftLowerArm) addPedClothes(source, playerTattoosRightUpperArm) addPedClothes(source, playerTattoosRightLowerArm) addPedClothes(source, playerTattoosBack) addPedClothes(source, playerTattoosLeftChest) addPedClothes(source, playerTattoosRightChest) addPedClothes(source, playerTattoosStomach) addPedClothes(source, playerTattoosLowerBack) addPedClothes(source, playerNecklace) addPedClothes(source, playerWatch) addPedClothes(source, playerGlasses) addPedClothes(source, playerHat) addPedClothes(source, playerExtra) end end end addEventHandler("onPlayerLogin", getRootElement(), playerLogin)
-
oh ok then. thank you guys Edit: ok Kenix
-
Oh seems easier. thank you again