Tete omar Posted May 30, 2012 Share Posted May 30, 2012 local Marker = createMarker ( 2056.0913085938, 1542.1124388281, 10.671875, "cylinder", 1.29999995, 255, 0, 0, 255 ) addEventHandler('onClientMarkerHit', Marker, function(hitPlayer) if (hitPlayer == localPlayer) then guiSetVisible(GUIEditor_Window[1], true) showCursor(true) end end) function CreateGUIWindow() GUIEditor_Window = {} GUIEditor_Memo = {} GUIEditor_Button = {} GUIEditor_Window[1] = guiCreateWindow(502,268,480,290,"glallllalll",false) GUIEditor_Button[1] = guiCreateButton(155,251,69,30,"exit",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(10,251,91,30,"lol",false,GUIEditor_Window[1]) GUIEditor_Memo[1] = guiCreateMemo(15,20,219,221,"Type any thing here",false,GUIEditor_Window[1]) guiSetVisible(GUIEditor_Window[1], false) addEventHandler("onClientGUIClick", GUIEditor_Button[2], kalla, false) end addEventHandler("onClientResourceStart", root, CreateGUIWindow) addEventHandler('onClientGUIClick', root, function () if ( source == GUIEditor_Button[1] ) then guiSetVisible(GUIEditor_Window[1],false) guiSetInputEnabled(false) showCursor(false) elseif ( source == GUIEditor_Button[4] ) then guiSetVisible(GUIEditor_Window[2],false) guiSetInputEnabled(false) showCursor(false) end end) function kalla() givePlayerMoney ( 900000 ) outputChatBox("#00ff00 Thanks",255,255,255,true) -- i want it here GUIEditor_Label = {} GUIEditor_Label[1] = guiCreateLabel(300,147,786,433,"Hey you thanks !",false) guiLabelSetColor(GUIEditor_Label[1],255,0,0) guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",true) guiSetFont(GUIEditor_Label[1],"sa-header") guiSetVisible(GUIEditor_Window[1],false) guiSetInputEnabled(false) showCursor(false) end is there any code to give a weapon on client side ? Link to comment
Stanley Sathler Posted May 30, 2012 Share Posted May 30, 2012 I guess not. You must create a function server-side and call it adding a custom event. Example: addEvent("myCustomEvent", true) function myFunction() -- ... your code goes here end addEventHandler("myCustomEvent", getRootElement(), myFunction) Later, call it from client-side triggerServerEvent("myCustomEvent", getRootElement()) Link to comment
X-SHADOW Posted May 30, 2012 Share Posted May 30, 2012 You Cant Give Weapon ClientSide You have to use triggerServerEvent. ---make a triggerServerEvent-- addEventHandler('onClientGUIClick', root, function() if ( source == 'Here the Stuped GUI Button') then triggerServerEvent('onStupedWeapon', localPlayer) end ---serverSide addEvent('onStupedWeapon', true) addEventHandler('onStupedWeapon', root, function() giveWeapon ( source, 31, 200 )--- give him M-4 with 200 ammo outputChatBox('Wow You Have Got Your Stuped Weapon.',source,255,255,0) end) end) Link to comment
Tete omar Posted May 30, 2012 Author Share Posted May 30, 2012 x-shadow even you can't spell stupid StanleySathler thanks Link to comment
X-SHADOW Posted May 30, 2012 Share Posted May 30, 2012 HaHa You'r Right But i can Script realy its easy to make this give weapon thing 1# addEvent Hanlder-- clientSide #2 trigger it -- server give it and add the event esay to do if you got any problem i can help you Link to comment
Tete omar Posted May 30, 2012 Author Share Posted May 30, 2012 HaHa You'r Right But i can Script realy its easy to make this give weapon thing 1# addEvent Hanlder-- clientSide #2 trigger it -- server give it and add the event esay to do if you got any problem i can help you thanks brother Link to comment
Tete omar Posted June 1, 2012 Author Share Posted June 1, 2012 Be welcome. Why it says "=" expected near end --Server side addEvent("onVehicleRide", true) function vehicleas() warpPedIntoVehicle end -- = here ? addEventHandler("onVehicleRide", localPlayer, vehicleas) --Client side function vehicleas() local Marker = createMarker ( -29.7998046875, 5.8994140625, 2.0999999046326, "cylinder", 3, 234, 70, 0, 19 ) addEventHandler('onClientMarkerHit', Marker,function(hitPlayer) if (hitPlayer == localPlayer) then local vehicle = createVehicle ( 532, -29.7998046875 , 5.8994140625, 5.8994140625 ) triggerServerEvent ( "onVehicleRide", localPlayer ) end end) end Link to comment
Alpha Posted June 1, 2012 Share Posted June 1, 2012 In serverside, warpPedIntoVehicle missing parentheses and arguments. Link to comment
Tete omar Posted June 1, 2012 Author Share Posted June 1, 2012 In serverside, warpPedIntoVehicle missing parentheses and arguments. How ?! Link to comment
Alpha Posted June 1, 2012 Share Posted June 1, 2012 --Server side addEvent("onVehicleRide", true) function vehicleas() warpPedIntoVehicle end -- = here ? addEventHandler("onVehicleRide", localPlayer, vehicleas) warpPedIntoVehicle How could this possible be a correct syntax to call a function? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now