komal

Members
  • Content Count

    27
  • Joined

  • Last visited

Community Reputation

4 Neutral

About komal

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. what about if you destroy the player can you try the code for me, if working ? addEventHandler( "onPlayerWasted", getRootElement( ), function() setCameraMatrix(source,vector3(getElementPosition(source)),vector3(getElementPosition(source))) destroyElement(source) end )
  2. that because the camera follow the Vehicle you need unfollow the camera try the code if this work ... addEventHandler( "onPlayerWasted", getRootElement( ), function() setCameraMatrix(source,vector3(getElementPosition(source)),vector3(getElementPosition(source))) end )
  3. you need applie the shader to the txd , i know you dont understand in shader so i build simple script how this work . https://community.multitheftauto.com/index.php?p=resources&s=details&id=16502
  4. use smoke_flare sa-mp https://community.mtasa.com/index.php?p=resources&s=details&id=1292
  5. your problem here local players = getElementsByType("players") replace it to: local players = getElementsByType ( "player" )
  6. because mta debug use the Lua debug librarya so Lua only write file line + function error without resource name you can fix your debugscript view with the script addEventHandler ("onClientDebugMessage",getRootElement(), function(message,level,file,line) outputDebugString ("\n ==============================================") outputDebugString (message) outputDebugString ("file :" .. file) outputDebugString ("line :" .. line) end)
  7. why you dont use player join event in server side ? function playerjoinToserver() addEventHandler ( "onPlayerJoin", getRootElement(),playerjoinToserver) https://wiki.multitheftauto.com/wiki/OnPlayerJoin ==== this is your full code client function text() dxDrawText("Alive Players[#334455"..home_alive.."#ffffff/"..tagColor..enemy_team.."#ffffff]",sX,sY*0.03,sX*0.2,sY*0,tocolor(255,255,255,generalAlpha),clanwar_data_fontSize*1.2,clanwar_data_font,"center","center",false,false,false,true) end addEventHandler("onClientRender", root, text) server teams = {} colour = {} colour.r = 255 colour.g = 85 colour.b = 85 enemyName = "enemyName" local tagColor function updateTeamSettings(playerSource,cmd,R,G,B) local playerName = getPlayerName(playerSource) local account = getPlayerAccount (playerSource) local account_name = getAccountName(account) if isObjectInACLGroup ( "user." .. account_name, aclGetGroup ( "Admin" )) then if not tonumber(R) or not tonumber(G) or not tonumber(B) then outputChatBox("#313131こコBOT#ffffff| #ffffffWrong Syntax #abcdef/color R G B",playerSource,255,255,255,true) return end R,G,B = tonumber(R),tonumber(G),tonumber(B) outputChatBox("#313131こコBOT#ffffff| #ffffffTeam Colour successfully changed",playerSource,255,255,255,true) local enemyTeam = getTeamFromName(enemyName) if enemyTeam then teams[2] = enemyTeam setTeamColor (enemyTeam,R,G,B) else teams[2] = createTeam ( enemyName,R,G,B) if teams[2] then setTeamColor (teams[2],R,G,B) end end end end addCommandHandler("color",updateTeamSettings) function updateTeamColour(team,r,g,b) setTeamColor (team,r,g,b) end function joinplr() setTeamColor (getTeamFromName(enemyName),math.random(1,255),math.random(1,255),math.random(1,255)) end addEventHandler("onPlayerJoin", getRootElement(), joinplr)
  8. your worng is in client side here if enemyTeam then <<<<<<<<<<<<<<<<<< your should write your team name with getTeamFromName("write your team here") your full codes shoud be like that Client side : local colour = {} local tagColor local teams = {} colour.r = 128 colour.g = 128 colour.b = 128 function updateTeamSettings(cmd,R,G,B) if not tonumber(R) or not tonumber(G) or not tonumber(B) then return end R,G,B = tonumber(R),tonumber(G),tonumber(B) if getTeamFromName("enemyName") then teams[2] = getTeamFromName("enemyName") triggerServerEvent ( "updateTeamColour", resourceRoot,getTeamFromName("enemyName"),R,G,B) end end addCommandHandler("color",updateTeamSettings) function tryRandomClr() triggerServerEvent ( "updateTeamColour", resourceRoot,getTeamFromName("enemyName"), math.random(1,255),math.random(1,255),math.random(1,255)) end addEventHandler("onClientPlayerJoin", getRootElement(),tryRandomClr) function text() dxDrawText("Alive Players[#334455"..home_alive.."#ffffff/"..tagColor..enemy_team.."#ffffff]",sX,sY*0.03,sX*0.2,sY*0,tocolor(255,255,255,generalAlpha),clanwar_data_fontSize*1.2,clanwar_data_font,"center","center",false,false,false,true) end addEventHandler("onClientRender", root, text) server side : teams = {} colour = {} colour.r = 255 colour.g = 85 colour.b = 85 enemyName = "enemyName" local tagColor function updateTeamSettings(playerSource,cmd,R,G,B) local playerName = getPlayerName(playerSource) local account = getPlayerAccount (playerSource) local account_name = getAccountName(account) if isObjectInACLGroup ( "user." .. account_name, aclGetGroup ( "Admin" )) then if not tonumber(R) or not tonumber(G) or not tonumber(B) then outputChatBox("#313131こコBOT#ffffff| #ffffffWrong Syntax #abcdef/color R G B",playerSource,255,255,255,true) return end R,G,B = tonumber(R),tonumber(G),tonumber(B) outputChatBox("#313131こコBOT#ffffff| #ffffffTeam Colour successfully changed",playerSource,255,255,255,true) local enemyTeam = getTeamFromName(enemyName) if enemyTeam then teams[2] = enemyTeam setTeamColor (enemyTeam,R,G,B) else teams[2] = createTeam ( enemyName,R,G,B) if teams[2] then setTeamColor (teams[2],R,G,B) end end end end addCommandHandler("color",updateTeamSettings) function updateTeamColour(team,r,g,b) setTeamColor (team,r,g,b) end addEvent("updateTeamColour", true) addEventHandler("updateTeamColour", resourceRoot, updateTeamColour)
  9. you can use MTA NPC Traffic or this https://www.mta-resource.ru/load/resource/id/853
  10. you cant use return pulsa try with the code --server: function getPulsa(phone) local phoneSettings = mysql:query_fetch_assoc("SELECT * FROM `phones` WHERE `phonenumber`='"..mysql:escape_string(tostring(phone)).."' LIMIT 1") local pulsa = 0 if not phoneSettings then outputChatBox("ERROR", source, 255, 0, 0) else pulsa = tonumber(phoneSettings["pulsa"]) or 0 triggerEvent ( "printData", root, pulsa ) end end addEvent("getPulsa", true) addEventHandler("getPulsa", root, getPulsa) --client: function getPulsa(nomor) triggerServerEvent("getPulsa", localPlayer, tonumber(nomor)) end function testPulsa(commandName, nomoer) local pulsa = getPulsa(nomoer) end addCommandHandler("getpulsa", testPulsa, false, false) function printData(data) outputChatBox(data) end addEvent("printData", true) addEventHandler("printData", root,printData)
  11. setTeamColor Server-only function https://wiki.multitheftauto.com/wiki/SetTeamColor to fix it use https://wiki.multitheftauto.com/wiki/TriggerServerEvent server file function changeclr ( tesm,r,g,b ) setTeamColor ( team,r,g,b )end addEvent( "changeclr", true ) addEventHandler( "changeclr", resourceRoot,changeclr ) client your full code + function updateTeamColour() triggerServerEvent ( "changeclr", resourceRoot,team[2], colour.r, colour.g, colour.b ) end addEventHandler("onClientPlayerJoin", getRootElement(), updateTeamColour)