-
Posts
1,491 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Walid
-
it must be like this : addEventHandler( "onClientRender",root, function( ) local px, py, pz, tx, ty, tz, dist px, py, pz = getCameraMatrix( ) local players = getElementsByType ( "player" ) for _, v in ipairs(players) do tx, ty, tz = getElementPosition( v ) dist = math.sqrt( ( px - tx ) ^ 2 + ( py - ty ) ^ 2 + ( pz - tz ) ^ 2 ) if dist < 30.0 then if isLineOfSightClear( px, py, pz, tx, ty, tz, true, false, false, true, false, false, false,v ) then local sx, sy, sz = getPedBonePosition( v, 6 ) local x,y = getScreenFromWorldPosition( sx, sy, sz + 0.3 ) if x then local team = getPlayerTeam(v) if team then r, g, b = getTeamColor(team) setPlayerNametagColor(v, r, g, b) else r, g, b = getPlayerNametagColor(v) end dxDrawText( getPlayerName(v), x, y, x, y, tocolor(r,g, b), 0.85 + ( 15 - dist ) * 0.04, "default-bold", "center" ) end end end end end )
-
No ,maybe you can use setTimer to check if the player is inside a plane.
-
replace player with client here function asd() givePlayerMoney(client,1) -- money here outputChatBox("test",client,255,0,0) end addEvent("onVehicleDriftEnd", true) addEventHandler("onVehicleDriftEnd", getRootElement(), asd)
-
there is 'end' missing Try this one: addEventHandler( "onClientRender",root, function( ) local px, py, pz, tx, ty, tz, dist px, py, pz = getCameraMatrix( ) for _, v in ipairs( getElementsByType 'player' ) do tx, ty, tz = getElementPosition( v ) dist = math.sqrt( ( px - tx ) ^ 2 + ( py - ty ) ^ 2 + ( pz - tz ) ^ 2 ) if dist < 30.0 then if isLineOfSightClear( px, py, pz, tx, ty, tz, true, false, false, true, false, false, false,localPlayer ) then local sx, sy, sz = getPedBonePosition( v, 6 ) local x,y = getScreenFromWorldPosition( sx, sy, sz + 0.3 ) if x then local team = getPlayerTeam(localPlayer) if team then r, g, b = getTeamColor(team) setPlayerNametagColor(localPlayer, r, g, b) else r, g, b = getPlayerNametagColor(localPlayer) end dxDrawText( getPlayerName(localPlayer), x, y, x, y, tocolor(r,g, b), 0.85 + ( 15 - dist ) * 0.04, "default-bold", "center" ) end end end end end )
-
You need to add the color { r,g,b} here like this dxDrawText( getPlayerName( localPlayer ), x, y, x, y, tocolor(r, g, b), 0.85 + ( 15 - dist ) * 0.04, "default-bold", "center" )
-
can you explane your problem better You don't need to use ACL group simply you can add Police Team.
-
debugscript ?
-
is that code client said man read the Wiki page Simply it can be like this. -- Server side function donatorL1(_,cur) local accName = getAccountName(cur) if isObjectInACLGroup("user."..accName, aclGetGroup("DL1")) then outputChatBox("Welcome To Your Donator Level 1.",source, 60, 255, 0) end end addEventHandler("onPlayerLogin", getRootElement(), donatorL1)
-
Try this one function saveAccount() local account = getPlayerAccount( source ) if ( account ) and ( not isGuestAccount( account ) ) then local x, y, z = getElementPosition( source ) local _, _, rotation = getElementRotation( source ) local position = { skin = getElementModel( source ), x = x, y = y, z = z, interior = getElementInterior( source ), dimension = getElementDimension( source ), rotation = rotation } local stats = { money = getPlayerMoney( source ), health = getElementHealth( source ), armor = getPedArmor( source ) } local weapons = { } for i = 0, 12 do weapons[ i ] = { weapon = getPedWeapon( source ), ammo = getPedTotalAmmo( source, i ) } end setAccountData( account, "account.position", toJSON( position ) ) setAccountData( account, "account.stats", toJSON( stats ) ) setAccountData( account, "account.weapons", toJSON( weapons ) ) end end addEventHandler( "onPlayerQuit", root, saveAccount ) addEventHandler( "onPlayerWasted", root, saveAccount ) addEventHandler( "onPlayerLogout", root, saveAccount ) addEventHandler( "onPlayerLogin", root, function( _, account ) local position = getAccountData( account, "account.position" ) if ( position ) then position = fromJSON( position ) spawnPlayer( source, position.x, position.y, position.z, position.rotation, position.skin, position.interior, position.dimension ) else spawnPlayer( source, 2485, -1665, 13.5, 0, 0, 0, 0 ) end setCameraTarget( source, source ) fadeCamera( source, true, 2.0 ) local stats = getAccountData( account, "account.stats" ) if ( stats ) then stats = fromJSON( stats ) setElementHealth( source, stats.health ) setPedArmor( source, stats.armor ) setPlayerMoney( source, stats.money ) end local weapons = getAccountData( account, "account.weapons" ) if ( weapons ) then weapons = fromJSON( weapons ) for i, data in pairs( weapons ) do giveWeapon( source, data.weapon, data.ammo, false ) end end end ) function dead() spawnPlayer( source, 2485, -1665, 13.5, 0, 0, 0, 0 ) local account = getPlayerAccount(source) local stats = getAccountData( account, "account.stats" ) if ( stats ) then stats = fromJSON( stats ) setElementHealth( source, stats.health ) setPedArmor( source, stats.armor ) setPlayerMoney( source, stats.money ) end local weapons = getAccountData( account, "account.weapons" ) if ( weapons ) then weapons = fromJSON( weapons ) for i, data in pairs( weapons ) do giveWeapon( source, data.weapon, data.ammo, false ) end end end addEventHandler ("onPlayerWasted", root, dead)
-
Check this maybe it can help you : Click me.
-
Yeh next time try to do it by yourself , so i recommend your to read this page before you start thinking to use leaked resources.
-
as far as i know there is only one and i already i gave it to you here i'm not sure because i didn't test it.
-
idk , let me check 1min .. ----------------------------------------- , Mr.Pro yes it's Server Side function="getPlayerGang" type="server"/> So what i'll do now ? make a copy and edit it to Client Side ? Like this function="getPlayerGang" type="client"/> lol, now i will never help you because you have proved to me that you are not the owner of the script . Leacked resource.
-
Are you sure that the export function is client side because i'm pretty sure that it's server side. exports["CSTgang"]:getPlayerGang
-
replace this addEventHandler("onClientResourceStart", resourceRoot, ReplaceSkin) with this addCommandHandler("customskin", ReplaceSkin)
-
replace "OnVehicleEnter" with "onVehicleEnter".
-
vérifiez votre internal.db s'il y a une table (accounts). ou vérifiez le chemin de votre internal.db
-
translated to the client again does not work, decided to open the debug and this is what is written bad argument @, getDistanceBetweenPoints3D' [expected vector3 at argument 4, got nill] this is how you ca fix it you must edit it by your self local Text = { -- text , position { x , y ,z } , color { r, g, b} {text="put text here", tx = , ty = , tz = ,r = 255, g = 0, b = 0}, } local screenX , screenY = guiGetScreenSize () function DrawText() for a,b in pairs(Text) do local x,y = getScreenFromWorldPosition(b["tx"], b["ty"], b["tz"]+0.2) local camX,camY,camZ = getCameraMatrix() if (x and y and getDistanceBetweenPoints3D(camX, camY, camZ, b["tx"], b["ty"], b["tz"]) <= 20) then dxDrawText ( b["text"] , x , y , x , y , tocolor (b["r"], b["g"], b["b"], 255) , ( screenX / 1440 ) * 2 , "default-bold" , "center" , "center" , false , true , false ) end end end addEventHandler("onClientPreRender", root, DrawText)
-
next time try to post the debugscript + show me the code. [2015-05-09 22:45:21] ERROR: [gameplay]/qwerty/server.lua:22: attempt to call global 'guiGetScreenSize' (a nil value) [2015-05-09 22:45:21] qwerty restarted successfully Man it's client side
-
next time try to post the debugscript + show me the code.