Derpy Posted August 15, 2014 Posted August 15, 2014 hello im trying practice to know how triggerClientEvent/triggerServerEvent work but need help server function sendPlayerCount() local playerCount = getPlayerCount() triggerClientEvent("onPlayerCountChange",resourceRoot,playerCount) end addEventHandler("onPlayerJoin",root,sendPlayerCount) addEventHandler("onPlayerQuit",root,sendPlayerCount) client addEvent("onPlayerCountChange",true) players = 0 local screenWidth,screenHeight = guiGetScreenSize() function drawCount() dxDrawText(players,screenWidth/2,screenHeight/2,screenWidth/2,screenHeight/2,tocolor(0,0,255,255),1,"bankgothic") end addEventHandler("onClientRender",root,drawCount) function totalFreeroamPlayerNumber(playerCount) if playerCount then players = playerCount else return end end addEventHandler("onPlayerCountChange",root,totalFreeroamPlayerNumber)
Et-win Posted August 15, 2014 Posted August 15, 2014 addEvent("onPlayerCountChange", true) Add that too. (Above addEventHandler) ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
Derpy Posted August 15, 2014 Author Posted August 15, 2014 i really doubt that i need that and i tested and it nno work
Et-win Posted August 15, 2014 Posted August 15, 2014 players = 0 local screenWidth,screenHeight = guiGetScreenSize() function drawCount() dxDrawText(tostring(players),screenWidth/2,screenHeight/2,screenWidth/2+150,screenHeight/2+150,tocolor(0,0,255,255),1,"bankgothic") end addEventHandler("onClientRender",root,drawCount) function totalFreeroamPlayerNumber(playerCount) if playerCount then players = playerCount else return end end addEvent("onPlayerCountChange",true) addEventHandler("onPlayerCountChange",root,totalFreeroamPlayerNumber) ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
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