-
Posts
459 -
Joined
-
Last visited
Everything posted by FuriouZ
-
So small problem Thanks !
-
If player enters to the bike, he gets random helmet local validHelmets = { { "moto", "moto" }, { "helmet", "helmet" }, } addEventHandler("onClientVehicleEnter", root, function() if ( getPedSkin( getLocalPlayer() ) == 0 and getVehicleType( getPedOccupiedVehicle( getLocalPlayer() ) ) == "Bike" ) then local randomType = (unpack(validHelmets[math.random(#validHelmets)])) addPedClothes ( localPlayer, randomType, 16 ) end end)
-
Heey I have problem with my code, i cant figure it out how i should use math.random on it local validHelmets = { { [ "moto", "moto" ] }, { [ "helmet", "helmet" ] }, } local helmet_type = " ", " " local randomType = math.random( 1, #validHelmets [ helmet_type ] ) addPedClothes ( localPlayer, randomType, 16 ) Thanks !
-
Yes, it will be probably one of the most famous servers if it is ever going to be true
-
Bad argument @ isVehicleOnGround addEventHandler("onVehicleDamage", root, function( loss, vehicle, seat, jacked ) local g_Vehicle = getVehicleOccupant(source) local vx,vy,vz = getElementVelocity(g_Vehicle) if vz < 0 then if not isVehicleOnGround(vehicle) then if ( tonumber( loss ) >= 350 ) then blowVehicle ( source ) end end end end )
-
I have another question, how i can check if vehicle is falling ? isVehicleOnGround ?
-
Thanks, it worked perfectly !
-
Yes, i know, but i wan't to do that if vehicle got more than 30% damage on wall hitting, then the car blows up
-
Hello! My question is how i can check how many damage the vehicle is taken ? For example, if vehicle is driving into the wall, how i can check how many damage vehicle got ?
-
Oh, sorry, i didn't saw that you posted the new code Thanks, it works perfectly now !
-
No, i didn't local screenW,screenH = guiGetScreenSize() local resW,resH = 1280,720 local sW,sH = (screenW/resW), (screenH/resH) It should draw "Reloading.. " under the weapon ammo and name like this: (works only this way " if ( clip < 1 and weapSlot == 3 ) then " ) but if i add move weaponSlot's then it doesn't draw it if i' am reloading or not
-
Of course local validWeaponSlots = { [ 2 ] = true, [ 3 ] = true, [ 4 ] = true, [ 5 ] = true, [ 6 ] = true, [ 7 ] = true, [ 8 ] = true, } addEventHandler("onClientRender", root, function() if getControlState ("aim_weapon") then local ammo = getPedTotalAmmo (getLocalPlayer()) local clip = getPedAmmoInClip (getLocalPlayer()) local weaponID = getPedWeapon(localPlayer) local weapName = getWeaponNameFromID(weaponID) local weapSlot = getPedWeaponSlot(getLocalPlayer()) local xBone,yBone,zBone = getPedBonePosition(getLocalPlayer(),8) local zBone = zBone - 0.5 local xSP,ySP = getScreenFromWorldPosition ( xBone,yBone,zBone ) if ( xSP and ySP ) then dxDrawText(weapName.." "..clip.." | "..ammo, xSP+100,ySP, 290*sW, 250*sH, tocolor (255, 255, 255, 255), 1.25*sW,1.25*sH,"default-bold","left","top",false,false,false,true) if ( clip < 1 and weapSlot == validWeaponSlots [ weapSlot ] ) then dxDrawText("Reloading...", xSP+100,ySP+20, 290*sW, 250*sH, tocolor (255, 255, 255, 255), 1.25*sW,1.25*sH,"default-bold","left","top",false,false,false,true) end end end end )
-
There's no errors in debug, even if i put only one valid weapon to table, it doesn't draw it I think the problem is in table ?
-
Now it doesn't draw reloading text at all, no errors in debug local validWeaponSlots = { { 2 }, { 3 }, { 4 }, { 5 }, { 6 }, { 7 }, { 8 }, } local clip = getPedAmmoInClip (getLocalPlayer()) local weapSlot = getPedWeaponSlot(getLocalPlayer()) if ( clip < 1 and weapSlot == validWeaponSlots ) then dxDrawText("Reloading...", xSP+100,ySP+20, 290*sW, 250*sH, tocolor (255, 255, 255, 255), 1.25*sW,1.25*sH,"default-bold","left","top",false,false,false,true) end
-
Hey! I'm trying to draw reloading text if bullets in weapon are < 1 and if player have gun.. So, everything works fine until i add more weapons to "weaponSlot" than one If i use local clip = getPedAmmoInClip (getLocalPlayer()) local weapSlot = getPedWeaponSlot(getLocalPlayer()) if ( clip < 1 and weapSlot == 3 ) then dxDrawText("Reloading...", xSP+100,ySP+20, 290*sW, 250*sH, tocolor (255, 255, 255, 255), 1.25*sW,1.25*sH,"default-bold","left","top",false,false,false,true) end then it draws "Reloading" always if player is reloading a gun, this is what i want but if i want add more weaponSlot's then it draws "Reloading" even if player isn't reloading local clip = getPedAmmoInClip (getLocalPlayer()) local weapSlot = getPedWeaponSlot(getLocalPlayer()) if ( clip < 1 and weapSlot == 2 or 3 or 4 or 5 or 6 or 7 or 8 ) then dxDrawText("Reloading...", xSP+100,ySP+20, 290*sW, 250*sH, tocolor (255, 255, 255, 255), 1.25*sW,1.25*sH,"default-bold","left","top",false,false,false,true) end also there isn't any errors in debug
-
Hello! Well, i have problem with level system, so if i get 100 xp then it doesn't set my level to 1 but if i have 101xp then it does The problem is probably here,but i don't have no idea how to fix it: if ( g_xp > 100 and g_xp < 500 ) then setElementData(source, "Level", "1") if i set if ( g_xp > 99 and g_xp < 499 ) then setElementData(source, "Level", "1") then it sets my level to 1 if i have xp 100
-
How i get the vehicle matrix ? something like this ? local vehicle = getPedOccupiedVehicle(localPlayer) local vehX, vehY, vehZ, vehLX, vehLY, vehLZ = getCameraMatrix (vehicle) local vcpSP,vcpSP = getScreenFromWorldPosition ( vehX, vehY, vehZ, vehLX, vehLY, vehLZ )
