SkatCh Posted November 7, 2014 Share Posted November 7, 2014 Hello there , i create a new ban system with a special view etc ... but the problem is how can i check the player serial before he press the login button . so which one i need to use "onPlayerJoin" or "onPlayerConnect". i tried this but didn't work . function checkBan() for index, ban in pairs(banList) do local serial = getPlayerSerial (source) if (ban[1] == serial) then triggerClientEvent(source, "showBanScreen", source,ban[1],ban[2], ban[3], ban[4]) end end end addEventHandler ( "onPlayerJoin", getRootElement(), checkBan ) banList -- special Table like getBans() Link to comment
TAPL Posted November 7, 2014 Share Posted November 7, 2014 You should first make sure that the player have their resources downloaded and loaded, so you should use onClientResourceStart then trigger to server side and check if he banned then trigger again to client side to show ban screen. Link to comment
SkatCh Posted November 7, 2014 Author Share Posted November 7, 2014 Sorry TAPL i don't undrestand your idea. Link to comment
TAPL Posted November 7, 2014 Share Posted November 7, 2014 --server function checkBan() for index, ban in pairs(banList) do local serial = getPlayerSerial (source) if (ban[1] == serial) then triggerClientEvent(source, "showBanScreen", source,ban[1],ban[2], ban[3], ban[4]) end end end addEvent("checkMyBan", true) addEventHandler("checkMyBan", root, checkBan) -- client addEventHandler("onClientResourceStart", resourceRoot, function() triggerServerEvent("checkMyBan", localPlayer) end) Link to comment
SkatCh Posted November 7, 2014 Author Share Posted November 7, 2014 bro i already fixed it, Thank you anyway Link to comment
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