-
Posts
19 -
Joined
-
Last visited
Posts posted by JCL
-
-
هدا المشكل يحدت معي في أي مرة أشغل الام تي أي قبل ما أضع سماعات الرأس.
لدا حاول اعادة تشغيل ام تي أي. وادا لم يشتغل الصوت . حاول تنصيبه من جديد
-
its client side script with custom animation combined with setPedAnimationSpeed.
custom animation is just a standard animation edited a bit.
- 1
-
use animation for that. you will get smooth fast run without accelerate the game and without glitchs
like this mode :
- 1
-
نسيت ازالة هدا السطر من الكود . كان لتجريب فقط
print(1)
-
function respawn_player_w(source,time) print(1) if isElement(source) and getElementType(source) == "player" then setElementAlpha(source, 100) setElementData(source, "SpawnProtected", true) toggleControl(source, "fire", false) setTimer(function () setElementData(source, "SpawnProtected", false) setElementAlpha(source, 255) toggleControl(source, "fire", true) end, time*1000, 1) return true else return false end end function call_spawn_function(ammo, attacker, weapon, bodypart) respawn_player_w(source,10); end addEventHandler('onPlayerWasted',root,call_spawn_function);
حسنا جرب هدا الكود .
عندما يموت الاعب انتضر 10 تواني
- 1
-
الكود الدي وضعته انت هو جيد و ليس به اي خطأ.
أعتقد مشكلتك هي طريقة استدعاء الفنكشن.
-
your question is about lua language performance and not about dx rendering .
-
-
this function dayzconnect:MySQL not exported well.
Try to start dayzconnect game mode first then start dayzmode resource after.
if that not worked , check if the function (dayzconnect:MySQL) exported well in dayzconnect meta.xml.
-
He went to eat. When he returns he will completes the question
-
المشكلة في الوقت. فاغلب المبرمجين لديهم عملهم و في وقت فراغهم يكفيهم فقط للمساعدة في شيء أو دعم سرفراتهم
-
what is the problem ?
-
-
Hi guys
Some friends asked me about the code for gta v camera or at least similar one, so , here is the code for it :
local camera_pan; local camera_tilt; local camera_temp_x; local camera_temp_y; local camera_temp_z; local camera_offset_x; local camera_offset_y; local camera_offset_z; local player_game_x; local player_game_y; local player_game_z; local first_enabled = 0; local mouse_move_x = 0; local mouse_move_y = 0; local camera_speed = 0.8; local enable_sidecamera = 1; localplayer = getLocalPlayer (); local fps = false; local function updateFPS(msSinceLastFrame) fps = (1 / msSinceLastFrame) * 1000; end addEventHandler("onClientPreRender", root, updateFPS) function check_gui_elements_visible() local windows = getElementsByType("gui-window") for i,window in pairs(windows) do if(guiGetVisible(window) == true) then return true end end return false; end function isPedAiming ( thePedToCheck ) if isElement(thePedToCheck) then if getElementType(thePedToCheck) == "player" or getElementType(thePedToCheck) == "ped" then if getPedTask(thePedToCheck, "secondary", 0) == "TASK_SIMPLE_USE_GUN" then return true; end end end return false; end function attach_camera(distance_x,distance_y) local is_any_gui_visible = check_gui_elements_visible(); if(is_any_gui_visible == true) then mouse_move_x = 0;mouse_move_y = 0;end if(isCursorShowing()) or (isConsoleActive()) or (isMainMenuActive()) or (isMTAWindowActive()) then mouse_move_x = 0;mouse_move_y = 0; end player_game_x ,player_game_y ,player_game_z = getElementPosition(localplayer); local time_step = 1; if(fps) then time_step = 1/fps; end camera_pan = camera_pan + 1 * mouse_move_x * time_step * 50; camera_tilt = camera_tilt + 1 * mouse_move_y * time_step * 50; if(camera_tilt > 0.8) then camera_tilt = 0.8; end if(camera_tilt < -2) then camera_tilt = -2; end local offset_x = player_game_x - distance_y * math.cos(camera_pan+180); local offset_y = player_game_y - distance_y * math.sin(camera_pan+180); local camera_x = offset_x - distance_x * math.cos(camera_pan); local camera_y = offset_y - distance_x * math.sin(camera_pan); local camera_z = player_game_z + 1 * -camera_tilt; camera_temp_x ,camera_temp_y,camera_temp_z = interpolateBetween (camera_temp_x,camera_temp_y,camera_temp_z,camera_x,camera_y,camera_z, camera_speed, "Linear"); camera_offset_x ,camera_offset_y,camera_offset_z = interpolateBetween (camera_offset_x,camera_offset_y,camera_offset_z,offset_x,offset_y,0, camera_speed, "Linear"); setCameraMatrix (camera_temp_x,camera_temp_y,camera_temp_z, camera_offset_x, camera_offset_y, player_game_z+0.5 ,0,100); end function camera_activation() if(enable_sidecamera == 1) then if(first_enabled == 0) then camera_pan = getPedCameraRotation(localPlayer)+180; first_enabled = 1; end local v = getPedOccupiedVehicle(localPlayer) if(v) then if(getCameraTarget () ~= v) then setCameraTarget (localPlayer); end else if(isPedAiming (localPlayer) == true) then if(getCameraTarget () ~= localPlayer) then setCameraTarget (localPlayer); end else attach_camera(1.5,-1); end end else first_enabled = 0; local v = getPedOccupiedVehicle(localPlayer) if(v) then if(getCameraTarget () ~= v) then setCameraTarget (v); end else if(getCameraTarget () ~= localPlayer) then setCameraTarget (localPlayer); end end end end addEventHandler ("onClientPreRender", getRootElement(), camera_activation); addEventHandler( "onClientCursorMove", getRootElement( ), function (x, y,_,_ ) local mouse_move_x2 = (0.5 - x) * 100; local mouse_move_y2 = (0.5 - y) * 100; mouse_move_x ,mouse_move_y = interpolateBetween (0,0, 0,mouse_move_x2,mouse_move_y2,0, 0.1, "Linear"); end );
Example
Feel free to ask any question about the code.
-
Ok, Dutchman101 thanks for the warning
I just add some infos about me and the server , but not sure if it's enough. Ok
-
Hi Guys
My name is dico, and i'm a programmer (c, c++, directx / opengl)
This month i start a server on my vps so i can get fun and knowing new friends around the world.
and what i did , is a new F1 panel created with new features like (new weapons, flying, god powers and many more)
in that menu there is 7 levels (player, vip, svip,mod,smod, admin, and Mode god)
The player earn levels by his hours until he get the final level "Mode God"
there is also a gate so players can get in and see another world with zombies and some horror scenes
you can go to this gate by typing in chat "/gate" or in console "gate" or the easiest way you can go to it from F1 panel
This server just for fun
and when i have time i will add more features to it.
a Video from the server
now the server info
Name : Anime Otaku
Ip : mtasa://35.237.220.10:22003
Hope I see you there guys !
- 1
[Sell] Angela's world resource
in Resources
Posted · Edited by DicoSky
removed