Jump to content

manve1

Retired Staff
  • Posts

    1,283
  • Joined

  • Last visited

Everything posted by manve1

  1. manve1

    Help wanted

    Ur right, but what event should i use?
  2. manve1

    Help wanted

    MTA forums changed the real name of event handlers ... and no no errors
  3. manve1

    Help wanted

    addEvent('needTheSh*t', true) addEventHandler('needTheSh*t', getLocalPlayer(), function() local bar = guiCreateProgressBar( 0.05, 0.75, 0.9, 0.05, true, computerGUI ) outputChatBox('#FF0000[iNFO]: #FFFFFFHacking in progress...', 255, 255, 255, true) capturing = setTimer( function() guiProgressBarSetProgress(bar, guiProgressBarGetProgress(bar) + 5) if ( guiProgressBarGetProgress(bar) == 100 ) then outputChatBox('#FF0000[iNFO]: #FFFFFFHacking finnished.', 255, 255, 255, true) triggerServerEvent('changecolor1topdeck', localPlayer) killTimer( capturing ) if isElement( bar ) and (bar) then destroyElement( bar ) end end end, 1000, 0 ) addEvent('noNeedTheSh*t', true) addEventHandler('noNeedTheSh*t', getLocalPlayer(), function() if isElement( bar ) and (bar) then destroyElement( bar ) if ( capturing ) then killTimer( capturing ) end end end ) end )
  4. manve1

    Help wanted

    No errors, after all, i use debugscript 3 for all of my scripts EDIT: This is server-side
  5. manve1

    Help wanted

    I got a problem when i try to get marker color for an output message local topdeck = createMarker( 170, 255, 9.5, 'cylinder', 2.0, 255, 255, 255, 100 ) addEvent('changecolor1topdeck', true) addEventHandler('changecolor1topdeck', getRootElement( ), function( ) if ( getElementType ( source ) == "player" ) then local nR, nG, nB = getTeamColor( getPlayerTeam( source ) ) setMarkerColor( topdeck, nR, nG, nB, 100 ) end end ) function nana() local r1, g1, b1, a1 = getMarkerColor( topdeck ) if ( r1 == 0 and g1 == 255 and b1 == 0 ) then outputChatBox( '#FF0000[iNFO]: LOL Fail.', root, 255, 255, 255, true ) end end
  6. try: local veh = createVehicle( 411, 2772, -2631, 16, 0, 0, 90 ) if not to this side then: local veh = createVehicle( 411, 2772, -2631, 16, 0, 0, 270 )
  7. Manve1 all I see from you is scripting mistakes, your code will make everyone in the the server god mode when a player is damaged. You need to make the god mode clientsided, and you should never rely on names, use serials / account. I understand your new to this, but he wants a solid working code. I'm not new, just at that point I was bit tired... after all, i don't know his serial or IP so i can't help him.
  8. It was made for people that don't understand triggering
  9. What you do is make a script and you need to trigger something? I bet your like 'How do I do it?' Well, this will help you! Triggering is a simple way of getting information from on side to another (( client to server OR server to client )) well, If you was triggering from Client side to server side, your script should look like this: || Client Side || triggerServerEvent('whatever', localPlayer) || Server Side || addEvent('whatever', true) addEventHandler('whatever', getRootElement(), function() --code end ) I think that you will be thinking now 'What is he on about.' Well, this script isn't hard to understand. The 'triggerServerEvent' triggers the code in your function to server side, The 'whatever' bit in 'triggerServerEvent' is the Event name, The 'localPlayer' bit in 2nd argument of 'triggerServerEvent' is for the person(s) you are trying to trigger the function too. IT is the same for the 'server side to client side', just with different elements on the 2nd argument. After all, I forgot to mension that after the 2nd argument of 'triggerClientEvent' or 'triggerServerEvent', you can add any arguments you like. Hope this helped you understand triggering client and server side. Ask for any questions. (( sorry for any mistakes. ))
  10. How can i fix it? After all, i changed source to topdeck, got no error, but it still is white, not the team colored
  11. CLIENT: local bar = guiCreateProgressBar( 0.05, 0.75, 0.9, 0.05, true, computerGUI ) capturing = setTimer( function() guiProgressBarSetProgress(bar, guiProgressBarGetProgress(bar) + 5) if ( guiProgressBarGetProgress(bar) == 100 ) then outputChatBox('#FF0000[iNFO]: #FFFFFFHacking finnished.', 255, 255, 255, true) triggerServerEvent('changecolor1topdeck', localPlayer) killTimer( capturing ) if isElement( bar ) and (bar) then destroyElement( bar ) end end end, 1000, 0 ) SERVER: addEvent('changecolor1topdeck', true) addEventHandler('changecolor1topdeck', getRootElement( ), function( thePlayer ) if ( thePlayer and getElementType ( thePlayer ) == "player" ) then local nR, nG, nB = getTeamColor( getPlayerTeam( thePlayer ) ) setMarkerColor( source, nR, nG, nB, 100 ) end end )
  12. no error now, but marker doesn't change color
  13. addEventHandler('onPlayerDamage', getRootElement(), function( ) if ( getPlayerName( getPlayerFromName( "#[iMr][E'rrOr]_N" ) ) ) then cancelEvent() end end )
  14. this you mean? ==> https://wiki.multitheftauto.com/wiki/SetPedStat
  15. addCommandHandler ( "vehicle", function ( thePlayer ) if isObjectInACLGroup ( "user." ..getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "RPC" ) ) then x, y, z = getElementPosition ( thePlayer ) theVehicle = createVehicle ( 411, x, y + 3, z ) end end ) addEventHandler ( "onVehicleStartEnter", root, function ( thePlayer, theSeat ) if source == theVehicle then if ( theSeat == 0 ) and ( getPlayerName ( thePlayer ) ~= "#[iMr][E'rrOr]_N" ) then cancelEvent ( ) outputChatBox ( "~][ This car is private ][~", thePlayer, 255, 255, 0, true ) else outputChatBox ( "~][Welcome sir][~", thePlayer, 255, 0, 0, true ) setVehicleDamageProof( getPedOccupiedVehicle ( getPlayerFromName ( "#[iMr][E'rrOr]_N" ) ), true ) end end end )
  16. It is a player, because I hit it.
  17. not sure if there is one, By me Triggering with server/client event function is best way
  18. its on /remove command
  19. https://wiki.multitheftauto.com/wiki/GetWeaponProperty https://wiki.multitheftauto.com/wiki/SetWeaponProperty
  20. problem is that u made the bindKey function same as the window name. Try: addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) local Main_Window = guiCreateWindow(251,243,533,256,"CMG Team Changer",false) local Memo_Info = guiCreateMemo(53,45,429,102,"With this script you can now change team, to stop Abuse we have made it cost 50k per team Change!\n\nCOSTS 50k!!! ",false,Main_Window) local Button_LS = guiCreateButton(58,171,115,58,"Change to LS",false,Main_Window) local Button_LV = guiCreateButton(219,171,115,58,"Change to LV",false,Main_Window) local Button_SF = guiCreateButton(383,171,115,58,"Change to SF",false,Main_Window) local Button_Close = guiCreateButton(479,21,40,24,"Close",false,Main_Window) guiWindowSetSizable(Main_Window, false) guiSetVisible(Main_Window, false) function Main_WindowFunction(keyPresser) if ( guiGetVisible(Main_Window) == false ) then guiSetVisible(Main_Window, true) showCursor(true) elseif ( guiGetVisible(Main_Window) == true ) then guiSetVisible(Main_Window, false) showCursor(false) end end bindKey("f5", "down", Main_WindowFunction) end ) EDIT: Copy code again.
  21. she? lol, after all, copy it again, and try the command EDIT: Try this one (( you must be admin to create the vehicle )) addCommandHandler('vehicle', function( p ) if isObjectInACLGroup ( "user." ..getAccountName ( getPlayerAccount ( p ) ), aclGetGroup ( "Admin" ) ) then local x, y, z = getElementPosition( p ) vehicle = createVehicle ( 411, x, y + 3, z ) end end ) addEventHandler ( "onVehicleEnter", root, function( player, seat, jacked ) if source == vehicle then if (seat == 0) and ( getPlayerFromName ( "#[iMr][E'rrOr]_N" ) ) then removePedFromVehicle ( thePed ) cancelEvent() outputChatBox ( "Welcome to your vehicle, sir.", player, 0, 0, 150, true ) elseif ( not getPlayerFromName ( "#[iMr][E'rrOr]_N" ) ) then outputChatBox('This vehicle is private.', player, 0, 0, 150, true) end end end )
  22. It should create an infernus near you
×
×
  • Create New...