Jump to content

Lordkrypton

Members
  • Posts

    20
  • Joined

  • Last visited

Everything posted by Lordkrypton

  1. Thank you but, i mean, how to link the ped who click in client-side to server-side, i know i can add arguments to triggerServerEvent but wich one ? Excuse my bad english Thnak you
  2. Thank you But i don't understand how to use the button. Look at what i did. Client : window = guiCreateWindow(0.25,0.25,0.1,0.5,"Vip Panel",true) guiSetAlpha( window, 1 ) guiWindowSetMovable(window,true) guiWindowSetSizable(window,false) guiSetVisible(window,false) showCursor(false) buttonjet = guiCreateButton( 0.05, 0.1, 1, 0.1, "Jetpack", true, window ) addEventHandler ( "onClientGUIClick", buttonjet, givejetpack, false ) function givejetpack () triggerServerEvent ( "onGiveJet", resourceRoot ) end --Binding to set window visible bindKey('k','down', function() guiSetVisible(window, not guiGetVisible(window)) showCursor(not isCursorShowing()) end ) server : function putjet() outputChatBox ( "test") end addEvent( "onGiveJet", true ) addEventHandler( "onGiveJet", resourceRoot, putjet ) Help me to link the button to the event putjet on server-side Thank you
  3. Hi, This is the first time i create a script with both server side & client side. It's like a vip panel, and only players for are vip ( meaning are friendly ) can open it. I don't understand how to make the jetpack button call a function in the server side ( givePedJetPack ). Can someone help me ? Thank you window = guiCreateWindow(0.25,0.25,0.1,0.5,"Vip Panel",true) guiSetAlpha( window, 1 ) guiWindowSetMovable(window,true) guiWindowSetSizable(window,false) guiSetVisible(window,false) showCursor(false) button = guiCreateButton( 0.05, 0.1, 1, 0.1, "Jetpack", true, window ) button = guiCreateButton( 0.05, 0.3, 1, 0.1, "blablabla", true, window ) --Binding to set window visible bindKey('k','down', function() guiSetVisible(window, not guiGetVisible(window)) showCursor(not isCursorShowing()) end )
  4. I create new file client.lua and paste it local r, g, b if (rank == 'Admin') then r, g, b = 255, 0, 0 elseif (rank == 'Moderator') then r, g, b = 0, 255, 0 elseif (rank =='Vip') then r, g, b = 255, 215, 0 elseif (rank == 'Guest') then r, g, b = 224, 255, 255 end But it's didn't work, there is no way to do it server-side like the output chatbox function ? Thanks
  5. How to make "Admin", "VIP", "Moderator" in color. Like create a variable for exemple : local admin = text("Admin", 255, 0, 255) ? and after setElementData ( source, "Rank", admin ) Thank you
  6. lol i'm stupid x) It's work so.. thank you a lot
  7. exports.scoreboard:addScoreboardColumn('Rank') function onJoin() setElementData ( source, "Rank", "Guest" ) end addEventHandler("onPlayerJoin",root,onJoin) function onLogin(_,acc) local aname = getAccountName(acc) if isObjectInACLGroup ( "user." .. aname, aclGetGroup ( "Admin" ) ) then setElementData ( source, "Rank", "Admin" ) elseif isObjectInACLGroup ( "user." .. aname, aclGetGroup ( "Moderator" ) ) then setElementData ( source, "Rank", "Moderator" ) elseif isObjectInACLGroup ( "user." .. aname, aclGetGroup ( "Vip" ) ) then setElementData ( source, "Rank", "Vip" ) else setElementData ( source, "Rank", "Player" ) end end addEventHandler("onPlayerLogin",root,onJoin) like that ?
  8. thank you for fast answer ! exports.scoreboard:addScoreboardColumn('Rank') function onJoin() setElementData ( source, "Rank", "Guest" ) end addEventHandler("onPlayerJoin",root,onJoin) function onLogin() local aname = getAccountName(source) if isObjectInACLGroup ( "user." .. aname, aclGetGroup ( "Admin" ) ) then setElementData ( source, "Rank", "Admin" ) elseif isObjectInACLGroup ( "user." .. aname, aclGetGroup ( "Moderator" ) ) then setElementData ( source, "Rank", "Moderator" ) elseif isObjectInACLGroup ( "user." .. aname, aclGetGroup ( "Vip" ) ) then setElementData ( source, "Rank", "Vip" ) else setElementData ( source, "Rank", "Player" ) end end addEventHandler("onPlayerLogin",root,onJoin) I'm a guest on scoreboard, what i did wrong ? Thank you
  9. Hi everyone I want to create a script who set a rank on every player : guest, player, vip, moderator, admin. I started to create something, but i have to reconnect everytime for test my script. Look exports.scoreboard:addScoreboardColumn('Rank') function rank() local aname = getAccountName(source) if isObjectInACLGroup ( "user." .. aname, aclGetGroup ( "Admin" ) ) then setElementData ( source , "Rank" , "Admin" ) else if isGuestAccount ( source ) then setElementData ( source , "Rank" , "Guest" ) else setElementData ( source, "Rank", "Player") end end end addEventHandler("onPlayerJoin",root,rank) If i want to set the element data everytime, not only when player connect, you know what i mean ? If someone is guest, and he register, i want him to be player without reconnect needed. Excuse my english Thank you
  10. Hi, I have make a script who create weapon on some defined place every random time. There is a quick way to convert x y z to region name like : Marine ( Los santos ) ? Thank you
  11. bad argument @ Set timer, expect number get bolean, i try something from https://wiki.multitheftauto.com/wiki/SetTimer but still bugged x) Thank you a lot for your help
  12. Kariiim, it's for this function, in freeroam gameplay : --------------------------- -- Repair vehicle --------------------------- function repairVehicle() local vehicle = getPedOccupiedVehicle(g_Me) if vehicle then server.fixVehicle(vehicle) end end addCommandHandler('repair', repairVehicle) addCommandHandler('rp', repairVehicle) AfuSensi, thank you, i still try to add it, but i have bug.
  13. Hi, I wanted to create a delays between 2 repair in freeroam mode. Like you press one time repair, and you have to wait 30 sec before repair a other time ? Can you help me to create the script, i don't have idea Thank you
  14. Hi, My script works, but i get some warning and error. I wanted to know how stop the function for avoid get this error, i try the "return" but it doesn't work. myblip1 = createBlip ( 1177,-1323,329.48090,22) -- LOS SANTOS marker1 = createMarker( 1177,-1323,13,"cylinder",1.5,255,0,0,225,getRootElement()) -- LOS SANTOS setBlipVisibleDistance( myblip1, 1500 ) myblip2 = createBlip ( -2651.3,626.7,329.48090,22) -- SF marker2 = createMarker( -2651.3,626.7,13.5,"cylinder",1.5,255,0,0,225,getRootElement()) --SF setBlipVisibleDistance( myblip2, 1500 ) myblip3 = createBlip ( 1608,1821,329.48090,22) -- LV marker3 = createMarker( 1608,1821,9.5,"cylinder",1.5,255,0,0,225,getRootElement()) -- LV setBlipVisibleDistance( myblip3, 1500 ) function health ( hitElement, matchingDimension ) if isPedInVehicle ( hitElement ) then outputChatBox ("You are in a vehicle", hitElement, 0 ,255, 0 ) else local ph = getElementHealth(hitElement) local ap = getPedArmor(hitElement) if ap < 100 then setPedArmor ( hitElement, 100 ) takePlayerMoney( hitElement, 250 ) outputChatBox ("You have set your armor to 100 for 250$.", hitElement, 0 ,255, 0 ) end if ph < 100 then outputChatBox ( "You have set your health to 100 for 250$.", hitElement, 0, 255, 0 ) setElementHealth ( hitElement, 100 ) setPedArmor ( hitElement, 100 ) takePlayerMoney( hitElement, 250) end end end addEventHandler( "onMarkerHit", marker1, health ) function health ( hitElement, matchingDimension ) if isPedInVehicle ( hitElement ) then outputChatBox ("You are in a vehicle", hitElement, 0 ,255, 0 ) else local ph = getElementHealth(hitElement) local ap = getPedArmor(hitElement) if ap < 100 then setPedArmor ( hitElement, 100 ) takePlayerMoney( hitElement, 250 ) outputChatBox ("You have set your armor to 100 for 250$.", hitElement, 0 ,255, 0 ) end if ph < 100 then outputChatBox ( "You have set your health to 100 for 250$.", hitElement, 0, 255, 0 ) setElementHealth ( hitElement, 100 ) setPedArmor ( hitElement, 100 ) takePlayerMoney( hitElement, 250) end end end addEventHandler( "onMarkerHit", marker2, health ) function health ( hitElement, matchingDimension ) if isPedInVehicle ( hitElement ) then outputChatBox ("You are in a vehicle", hitElement, 0 ,255, 0 ) else local ph = getElementHealth(hitElement) local ap = getPedArmor(hitElement) if ap < 100 then setPedArmor ( hitElement, 100 ) takePlayerMoney( hitElement, 250 ) outputChatBox ("You have set your armor to 100 for 250$.", hitElement, 0 ,255, 0 ) end if ph < 100 then outputChatBox ( "You have set your health to 100 for 250$.", hitElement, 0, 255, 0 ) setElementHealth ( hitElement, 100 ) setPedArmor ( hitElement, 100 ) takePlayerMoney( hitElement, 250) end end end addEventHandler( "onMarkerHit", marker3, health ) The error : When someone go on the marker with a vehicle, it's said : - Warning at line 55 Bad argument @ IsPedinVehicle expected ped at argument 1, got vehicle - Warning at line 59 Bad argument @ GetPedArmor expected ped at argument 1, got vehicle - Error at line 60 attempt to compare bolean with number. By the way if you can say me how to make different marker use the same function Thank you
×
×
  • Create New...