-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
Not just that.. look: local root = getRootElement() local player = getLocalPlayer() local gespielt = getElementData(source,"PlayedH")..":"..getElementData(source,"PlayedM") -- You're using "source" when you should use "player", also this has to be into the function else it won't work. addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() setElementData ( player, "Gesellschaftsstellung", "Bauer" ) setElementData ( player, "Spielzeit", gespielt ) setElementData ( player, "Nummer", "000" ) end ) function refreshZeit() setElementData( player(), "Spielzeit", gespielt ) -- You have an error here "()" after "player". end setTimer( refreshZeit, 60000, 0 )
-
No esta en ingles, al menos no todo, te di el link para la version en español.
-
You want to get them from the PED's or from the Player's?
-
Uhm... i can't remember what exactly, but, you had many, compare both codes, you may find it yourself .
-
Nice one, i wish you luck with it. P.S: My nick is: Solidsnake14 not Solidsnake64 .
-
I can say, this hosting it's really great, currently my server is hosted here, and I have no problems with it.
-
DeagleTM, if you are talking about the basic LUA script, then, yes, it's easy indeed. TXD = {} DFF = {} function load() TXD[1] = engineLoadTXD ( "myCar.txd" ) engineImportTXD ( TXD[1], myID ) DFF[1] = engineLoadDFF ( "myCar.dff", myID ) engineReplaceModel ( DFF[1], myID ) end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),load) function unLoad(command,id) destroyElement(TXD[id]) destroyElement(DFF[id]) outputChatBox("Vehicle unloaded!",255,0,0) end addCommandHandler("unload",unLoad) I think that should do the job.
-
La verdad que hacer eso es muy facil, debes entender algo de programacion claro esta, porque no empiezas a aprender y lo haces tu solo? https://wiki.multitheftauto.com/index.ph ... _Principal Si no entendes algo postea aca.
-
proracer, he doesn't want that if i'm right, he just wanted it to warn the desired player.
-
John, i don't know what do you mean, but he was adding the columns right. Btw, the rank/checkpoint columns are in race_server.lua, search for the keyword: scoreboard
-
I don't see why.. they can be used in the server/client side. local root = getRootElement() local player = getLocalPlayer() addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() local gespielt = tostring(getElementData(player,"PlayedH"))..":"..tostring(getElementData(player,"PlayedM")) setElementData ( player, "Gesellschaftsstellung", "Bauer" ) setElementData ( player, "Spielzeit", gespielt ) setElementData ( player, "Nummer", "000" ) end) function refreshZeit() local gespielt = tostring(getElementData(player,"PlayedH"))..":"..tostring(getElementData(player,"PlayedM")) setElementData( player, "Spielzeit", gespielt ) end setTimer( refreshZeit, 60000, 0 )
-
scofer, if you want him to script for you, you'll need to pay him.
-
Sounds like the script is not yours, else, you should have the 'findPlayer' function function warnPlayer ( theClient, command, target, reason) if ( hasObjectPermissionTo ( theClient, "function.warnPlayer" ) ) then local targetPlayer = getPlayerFromName ( target ) local playerAccount = getPlayerAccount ( targetPlayer ) local playerWarns = getAccountData ( playerAccount, "Warns" ) or 0 if ( playerWarns == 0 ) then setAccountData ( playerAccount, "Warns", tonumber(playerWarns) + 1 ) outputChatBox ( warnedPlayer.. "#FF0000 has been warned for " ..reason.. ".", getRootElement(), 255, 0, 0, true ) outputChatBox ( "You have been warned for " ..reason.. ". Now you have " ..playerWarns.. " of 3.", targetPlayer, 255, 0, 0, false ) elseif ( playerWarns == 1 ) then setAccountData ( playerAccount, "Warns", tonumber(playerWarns) + 1 ) outputChatBox ( warnedPlayer.. "#FF000 has been warned for " ..reason.. ".", getRootElement(), 255, 0, 0, true ) outputChatBox ( "You have been warned for " ..reason.. ". Now you have " ..playerWarns.. " of 3.", targetPlayer, 255, 0, 0, false ) elseif ( playerWarns == 2 ) then setAccountData ( playerAccount, "Warns", tonumber(playerWarns) + 1 ) outputChatBox ( warnedPlayer.. "#FF000 has been warned for " ..reason.. ". It was his last moment in this server...", getRootElement(), 255, 0, 0, true ) banPlayer ( targetPlayer, Console, "You got 3 warning of 3." ) end else outputChatBox ( "Warn: you don't have enough permissions.", theClient, 255, 255, 0, false ) end end
-
The server owner's could make a simple script to toggle the car mods on/off, but, maybe MTA should have it built-in.
-
Well, that's indeed strange, since it's not a problem from the resource/script.
-
Another vehicle mod(s): https://community.multitheftauto.com/ind ... ls&id=2188 https://community.multitheftauto.com/ind ... ls&id=2189
-
Well, firstly you should try to speak a better english, but, also, are you willing to pay for an scripter?
-
-- Login/Register local newUser local localPlayer = getLocalPlayer() local localPlayerName = getPlayerName(localPlayer) local localRootElement = getRootElement() local passwordAttempts = 0 GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Edit = {} function CreateLoginWindow() GUIEditor_Window[1] = guiCreateWindow(230,160,336,265,"J Login",false) guiSetAlpha(GUIEditor_Window[1],1) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) -- Buttons GUIEditor_Button[1] = guiCreateButton(22,184,143,40,"Login",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(201,184,123,44,"Register",false,GUIEditor_Window[1]) -- Labels guiCreateLabel(35,48,87,21,"Username:",false,GUIEditor_Window[1]) guiCreateLabel(37,90,53,17,"Password:",false,GUIEditor_Window[1]) -- Type in... GUIEditor_Edit[1] = guiCreateEdit(133,45,171,27,"",false,GUIEditor_Window[1]) guiEditSetMaxLength(GUIEditor_Edit[1],23) GUIEditor_Edit[2] = guiCreateEdit(128,95,186,28,"",false,GUIEditor_Window[1]) guiEditSetMasked(GUIEditor_Edit[2],true) guiEditSetMaxLength(GUIEditor_Edit[2],13) end function CreateRegisterWindow() GUIEditor_Window[2] = guiCreateWindow(197,122,369,330,"Register",false) guiSetAlpha(GUIEditor_Window[2],1) guiWindowSetMovable(GUIEditor_Window[2],false) guiWindowSetSizable(GUIEditor_Window[2],false) guiCreateLabel(39,48,64,15,"Username:",false,GUIEditor_Window[2]) guiCreateLabel(43,119,66,15,"Password:",false,GUIEditor_Window[2]) -- Type in... GUIEditor_Edit[3] = guiCreateEdit(122,49,205,26,"",false,GUIEditor_Window[2]) guiEditSetMaxLength(GUIEditor_Edit[3],23) GUIEditor_Edit[4] = guiCreateEdit(121,114,205,29,"",false,GUIEditor_Window[2]) guiEditSetMasked(GUIEditor_Edit[4],true) guiEditSetMaxLength(GUIEditor_Edit[4],13) -- Image guiCreateStaticImage(19,168,117,114,"images/mtalogo.png",false,GUIEditor_Window[2]) -- Buton GUIEditor_Button[2] = guiCreateButton(154,270,111,45,"Login",false,GUIEditor_Window[2]) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() CreateLoginWindow() -- if the GUI was successfully created, then show the GUI to the player if (GUIEditor_Window[1] ~= nil) then guiSetVisible(GUIEditor_Window[1], true) else -- if the GUI hasnt been properly created, tell the player outputChatBox("An unexpected error has occurred and the log in GUI has not been created.") end -- enable the players cursor (so they can select and click on the components) showCursor(true) -- set the input focus onto the GUI, allowing players (for example) to press 'T' without the chatbox opening guiSetInputEnabled(true) -- now add our onClientGUIClick event to the button we just created addEventHandler("onClientGUIClick",GUIEditor_Button[1], clientSubmitLogin, false) addEventHandler("onClientGUIClick",GUIEditor_Button[2], clientClickReg,false) end ) -- create the function and define the 'button' and 'state' parameters -- (these are passed automatically by onClientGUIClick) function clientSubmitLogin(button,state) if button == "left" and state == "up" then -- get the text entered in the 'username' field local username = guiGetText(GUIEditor_Edit[1]) -- get the text entered in the 'password' field local password = guiGetText(GUIEditor_Edit[2]) -- if the username and password both exist if username and password then -- trigger the server event 'submitLogin' and pass the username and password to it triggerServerEvent("submitLogin", getRootElement(), username, password) -- hide the gui, hide the cursor and return control to the player guiSetInputEnabled(false) guiSetVisible(GUIEditor_Window[1], false) showCursor(false) else -- otherwise, output a message to the player, do not trigger the server -- and do not hide the gui outputChatBox("Please enter a username and password.") end end end function clientClickReg() CreateRegisterWindow() if (GUIEditor_Window[2] ~= nil) then guiSetVisible(GUIEditor_Window[2], true) else -- if the GUI hasnt been properly created, tell the player outputChatBox("An unexpected error has occurred and the log in GUI has not been created.") end -- enable the players cursor (so they can select and click on the components) showCursor(true) -- set the input focus onto the GUI, allowing players (for example) to press 'T' without the chatbox opening guiSetInputEnabled(true) -- now add our onClientGUIClick event to the button we just created addEventHandler("onClientGUIClick",GUIEditor_Button[2], clientSubmitRegister, false) end -- create the function and define the 'button' and 'state' parameters -- (these are passed automatically by onClientGUIClick) function clientSubmitRegister(button,state) if button == "left" and state == "up" then -- get the text entered in the 'username' field local username = guiGetText(GUIEditor_Edit[3]) -- get the text entered in the 'password' field local password = guiGetText(GUIEditor_Edit[4]) -- if the username and password both exist if username and password then -- trigger the server event 'submitLogin' and pass the username and password to it triggerServerEvent("submitRegister", getRootElement(), username, password) -- hide the gui, hide the cursor and return control to the player guiSetVisible(GUIEditor_Window[2], false) guiSetVisible(GUIEditor_Window[1], false) end end end As far as I understand, you want to show the Login window after register, right? if so, that should work fine.
-
Post the server side part.
-
Try this: -- Login/Register local newUser local localPlayer = getLocalPlayer() local localPlayerName = getPlayerName(localPlayer) local localRootElement = getRootElement() local passwordAttempts = 0 GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Edit = {} function CreateLoginWindow() GUIEditor_Window[1] = guiCreateWindow(230,160,336,265,"J Login",false) guiSetAlpha(GUIEditor_Window[1],1) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) -- Buttons GUIEditor_Button[1] = guiCreateButton(22,184,143,40,"Login",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(201,184,123,44,"Register",false,GUIEditor_Window[1]) -- Labels guiCreateLabel(35,48,87,21,"Username:",false,GUIEditor_Window[1]) guiCreateLabel(37,90,53,17,"Password:",false,GUIEditor_Window[1]) -- Type in... GUIEditor_Edit[1] = guiCreateEdit(133,45,171,27,"",false,GUIEditor_Window[1]) guiEditSetMaxLength(GUIEditor_Edit[1],23) GUIEditor_Edit[2] = guiCreateEdit(128,95,186,28,"",false,GUIEditor_Window[1]) guiEditSetMasked(GUIEditor_Edit[2],true) guiEditSetMaxLength(GUIEditor_Edit[2],13) end function CreateRegisterWindow() GUIEditor_Window[2] = guiCreateWindow(197,122,369,330,"Register",false) guiSetAlpha(GUIEditor_Window[2],1) guiWindowSetMovable(GUIEditor_Window[2],false) guiWindowSetSizable(GUIEditor_Window[2],false) guiCreateLabel(39,48,64,15,"Username:",false,GUIEditor_Window[2]) guiCreateLabel(43,119,66,15,"Password:",false,GUIEditor_Window[2]) -- Type in... GUIEditor_Edit[3] = guiCreateEdit(122,49,205,26,"",false,GUIEditor_Window[2]) guiEditSetMaxLength(GUIEditor_Edit[3],23) GUIEditor_Edit[4] = guiCreateEdit(121,114,205,29,"",false,GUIEditor_Window[2]) guiEditSetMasked(GUIEditor_Edit[4],true) guiEditSetMaxLength(GUIEditor_Edit[4],13) -- Image guiCreateStaticImage(19,168,117,114,"images/mtalogo.png",false,GUIEditor_Window[2]) -- Buton GUIEditor_Button[2] = guiCreateButton(154,270,111,45,"Login",false,GUIEditor_Window[2]) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() CreateLoginWindow() -- if the GUI was successfully created, then show the GUI to the player if (GUIEditor_Window[1] ~= nil) then guiSetVisible(GUIEditor_Window[1], true) else -- if the GUI hasnt been properly created, tell the player outputChatBox("An unexpected error has occurred and the log in GUI has not been created.") end -- enable the players cursor (so they can select and click on the components) showCursor(true) -- set the input focus onto the GUI, allowing players (for example) to press 'T' without the chatbox opening guiSetInputEnabled(true) -- now add our onClientGUIClick event to the button we just created addEventHandler("onClientGUIClick",GUIEditor_Button[1], clientSubmitLogin, false) addEventHandler("onClientGUIClick",GUIEditor_Button[2], clientClickReg,false) end ) -- create the function and define the 'button' and 'state' parameters -- (these are passed automatically by onClientGUIClick) function clientSubmitLogin(button,state) if button == "left" and state == "up" then -- get the text entered in the 'username' field local username = guiGetText(GUIEditor_Edit[1]) -- get the text entered in the 'password' field local password = guiGetText(GUIEditor_Edit[2]) -- if the username and password both exist if username and password then -- trigger the server event 'submitLogin' and pass the username and password to it triggerServerEvent("submitLogin", getRootElement(), username, password) -- hide the gui, hide the cursor and return control to the player guiSetInputEnabled(false) guiSetVisible(GUIEditor_Window[1], false) showCursor(false) else -- otherwise, output a message to the player, do not trigger the server -- and do not hide the gui outputChatBox("Please enter a username and password.") end end end function clientClickReg() CreateRegisterWindow() if (GUIEditor_Window[2] ~= nil) then guiSetVisible(GUIEditor_Window[2], true) else -- if the GUI hasnt been properly created, tell the player outputChatBox("An unexpected error has occurred and the log in GUI has not been created.") end -- enable the players cursor (so they can select and click on the components) showCursor(true) -- set the input focus onto the GUI, allowing players (for example) to press 'T' without the chatbox opening guiSetInputEnabled(true) -- now add our onClientGUIClick event to the button we just created addEventHandler("onClientGUIClick",GUIEditor_Button[2], clientSubmitRegister, false) end -- create the function and define the 'button' and 'state' parameters -- (these are passed automatically by onClientGUIClick) function clientSubmitRegister(button,state) if button == "left" and state == "up" then -- get the text entered in the 'username' field local username = guiGetText(GUIEditor_Edit[3]) -- get the text entered in the 'password' field local password = guiGetText(GUIEditor_Edit[4]) -- if the username and password both exist if username and password then -- trigger the server event 'submitLogin' and pass the username and password to it triggerServerEvent("submitRegister", getRootElement(), username, password) -- hide the gui, hide the cursor and return control to the player guiSetInputEnabled(false) guiSetVisible(GUIEditor_Window[2], false) showCursor(false) end end end
-
I said, post the code.
-
What the hell is that? export info.htm??
-
Woot? i gave you the code to do that... , as far as i understand you want to show up the register window when he click's on some button called "Register", right? Post your full code here.
-
Never happend to me, make sure you did all things right, there has to be a problem, also, make sure that you have access to the command 'aexec' (this will be fixed in new version, custom commands for the c-panel in the acl.xml).
