
Chickelon12
Members-
Posts
44 -
Joined
-
Last visited
Everything posted by Chickelon12
-
So should when the player enter the marker i set his account data to 'setAccountData ( 'definetheacc', "arrests", 'and whatshould be here ??') about the money here is what you want function transfer( thePlayer ,button, state, absoluteX, absoluteY) if ( source == GUIEditor.button[2] ) then guiSetVisible (GUIEditor.window[1], false) showCursor (false) end if source == GUIEditor.button[1] then local to_who = guiGetText( GUIEditor.edit[2] ) amount = tonumber( guiGetText( GUIEditor.edit[1] ) ) if to_who == nil or to_who == false or to_who == "" then outputChatBox( "Please type the player name which you want to transfer the money to" ) elseif amount == nil then outputChatBox( "You must type the amount you want to withdraw!" ) elseif amount < 0 then outputChatBox( "Please enter a valid number" ) else local money = getPlayerMoney(thePlayer) if money < amount then outputChatBox( "You don't have that amount of money" ) else local getp = getPlayerFromName ( thePlayer ) outputChatBox(" "..getp.." gave "..to_who.." ".. amount.." ") triggerServerEvent ( "takegive", localPlayer ) end end end end addEventHandler( "onClientGUIClick", GUIEditor.button[1], transfer) addEventHandler( "onClientGUIClick", GUIEditor.button[2], transfer)
-
you didn't get what i said about the arrests, example i just arrested and jailed 2 criminals,, how to make someone see how many arrests he got ? about the money,, so i don't understand, should i triggerServerEvent in the client or leave the server as you wrote with editing "to_who" to "theGiver" ?? edit: i left the serverthe server as you wrote with editing "to_who" to "theGiver" but still not working and still the same debug script errors
-
now i am trying to do an arrest system, which when you arrest someone your arrests goes up, i have made the arrest thing ( when you hit someone with night stick he follows you, and you should transport him into a marker ) but idk how to make it count the arrests,, so maybe someone can help me,, btw i am not asking someone to make for me the code i want to learn it myself,, so i am just asking to post which functions should i use,, if i will have to use SQL or smthing else... etc i have made a transfer money gui,, it's working but i defined 'to_who' the money is going to be sent in client how to define it in server? for example client local to_who = guiGetText( GUIEditor.edit[2] ) server function givemoney ( ) givePlayerMoney ( to_who, amount ) takePlayerMoney ( source, amount ) end addEvent( "takegive", true ) addEventHandler( "takegive", root, givemoney ) i tried to trigger it but it's not working debugscript: Bad argument @ 'givePlayerMoney' Bad argument @ 'takePlayerMoney' as you all know i cannot use those functions (givePlayerMoney, takePlayerMoney ) in client because it got only 1 argument which is the amount
-
Well, i am not set to help as i am a beginner but i think that should work ( didn't test it ) addEventHandler ( "onClientVehicleEnter", getRootElement(), function ( thePlayer ) local teamName = getTeamName ( getPlayerTeam ( thePlayer ) ) if ( teamName == "WhiteTeam" or teamName == "BlackTeam") then local theVehicle = getPedOccupiedVehicle ( thePlayer ) destroyElement(theVehicle) end end )
-
skins = { '8', '42', '50'} function takejob ( thePlayer ) local mySkin = skins[ math.random( 1,#skins ) ] setElementModel(thePlayer, tonumber (mySkin))
-
Yes, but i am using 'thePlayer'
-
Still doesn't change the skin
-
now it gives me the id(50) only EDIT: it gave me it only 1 time then when i restarted the script, and gave my self another skin, the script doesn't change it
-
(1,#skins) only set my skin to 1(id) (1,3) sets random from 1 to 3
-
I have made a script which you should do a mission on a specific timer, when you are in mission if you wrote /timer then a dxText will appear showing the time left, actually the timer is 80000ms which is 80 sec, when i use /timer it shows the timer on miliseconds, how to make it shown in secs.. and how to make it a countdown, when i write /timer i made it to show the time remaining for 3 secs, so it writes for example 52032, without changing the text during the 3 secs, how to make it a countdown which changes the text ??? I am making a mechanic job,, so i wanted to if the player gets the job changes his skin to a random id from those (8, 42, 50) so i have made a table but idk what to write to make it random... skins = { '8', '42', '50'} local randomskin = math.random( #skins )
-
Citizen i didn't ignore what you said i tried both ways, but idk it didn't work when i tried before now your code works, Really thanks
-
Saml1er - your code didn't work Citizen - idk what really happened with your code, when i started the resource i clicked on the ped found the chatbox msgs appeared, but still the gui didn't work EDIT: Bad argument at 'getElementType'
-
Nothing happens, no debugscript errors, doesn't show "Text" in the main chat
-
Still not working it just puts "Test" in the chatbox when the resource starts, Debuscript 3: Server.lua:24: Bad argument @ 'triggerClientEvent' [Expected element at argument 3, got none]
-
Okay, i think i got it function guiwindow ( thePlayer ) if isPedInVehicle(thePlayer)==true then return end if (getElementType (thePlayer) == "player") then guiSetVisible(GUIEditor.window[1], true) showCursor ( true ) end end addEvent( "test", true ) addEventHandler( "test", root, guiwindow ) function pedclick ( theButton, theState, thePlayer ) local clickedElement = source if clickedElement == policeped and theButton == "left" and theState == "up" then triggerClientEvent ( thePlayer, "test") outputChatBox("Test") end end addEventHandler( "onElementClicked", root, pedclick ) still not working debug script is not showing errors,
-
Well, still nothing.. /debugscript 3 is not showing anyerrors, i am pretty sure the problem is from those parts which i gave you because when it was with the marker it worked well, but when i modified those parts to make it with a ped it didn't work...
-
Still not working i have read the wiki and found nothing wrong...
-
function guiwindow ( thePlayer ) if isPedInVehicle(thePlayer)==true then return end if (getElementType (thePlayer) == "player") then guiSetVisible(GUIEditor.window[1], true) showCursor ( true ) end end addEvent( "pedClick", true ) addEventHandler( "pedClick", root, guiwindow ) function pedclick (thePlayer) triggerClientEvent ( thePlayer, "pedClick") end addEventHandler( "onElementClicked", Policeped, pedclick )
-
so i have made a script when a player clicks on a marker a gui shows up and if he clicks on get job he gets moved to a team changing his skin and giving him a weapon, everything worked fine, then i wanted to change entering the marker to clicking on a ped, but then it didn't work ( i will not post the whole script i will just post the functions and eventhandlers which i used ) Client GUI: guiCreateWindow guiCreateMemo guiCreateButton guiCreateLabel Take job: isPedInVehicle getElementType guiSetVisible showCursor addEvent( "pedClick", true ) addEventHandler( "pedClick", root, guiwindow ) Cancel/takejob button: if ( source == GUIEditor.button[1] ) then triggerServerEvent guiSetVisible showCursor onClientGUIClick Server: createTeam createPed On clicking the takejob button: getPlayerTeam getTeamName outputChatBox setPlayerTeam setPedArmor giveWeapon setElementModel addEvent addEventHandler on clicking the ped: triggerClientEvent onElementClicked Debugscript 3 doesn't show any errors