Maksoud Posted June 5, 2016 Share Posted June 5, 2016 السلام عليكم شباب بدى كود يجيب اسم حساب اللاعب و يا ريت الكود يكون كامل و معاه شرح Link to comment
Maksoud Posted June 5, 2016 Author Share Posted June 5, 2016 getAccountName ذه كامل ؟ طب بص عايز تعديل على الكود ذه #Client guiSetText(Account,"Your Account : "..acc,triggerServerEvent("accountya",localPlayer)) #Server addEvent ("accountya",true) addEventHandler("accountya",root, function() local acc = getPlayerAccount(source) end) Link to comment
Ahmed Ly Posted June 6, 2016 Share Posted June 6, 2016 addEvent ("accountya",true) addEventHandler("accountya",root, function(acc) guiSetText(Account,"Your Account : "..acc.." ") end ) ---------------------------------------------------- function() local acc = getAccountName(getPlayerAccount(source)) triggerClientEvent("accountya",source,acc) end Link to comment
فاّرس Posted June 6, 2016 Share Posted June 6, 2016 (edited) ^ كودك خطأ . -- Client Side # addEventHandler( 'onClientResourceStart', resourceRoot, function ( ) triggerServerEvent ( 'getAccount', localPlayer ) end) addEvent ( 'setAccount', true ) addEventHandler ( 'setAccount', root, function( acc ) guiSetText ( Account, acc ) end) -- Server Side # addEvent ( 'getAccount', true ) addEventHandler ( 'getAccount', root, function ( ) if getPlayerAccount ( client ) and not isGuestAccount ( getPlayerAccount ( client ) ) then triggerClientEvent ( client, 'setAccount', client, getAccountName ( getPlayerAccount ( client ) ) ) end end ) Edited June 6, 2016 by Guest Link to comment
Ahmed Ly Posted June 6, 2016 Share Posted June 6, 2016 @The Best ليش حطيت acc بدل من getAccountName ( getPlayerAccount ( client ) ) ؟ Link to comment
فاّرس Posted June 6, 2016 Share Posted June 6, 2016 لأن ما يمديك تحطها بالكلينت, انا حطيتها بالتريقر ف السيرفر وارسلتها للكلينت triggerClientEvent ( client, 'setAccount', client, getAccountName ( getPlayerAccount ( client ) ) ) addEventHandler ( 'setAccount', root, function( acc ) acc اذا ارسلت شي من السيرفر للكلينت او العكس, يجي زي البرامتر داخل الفنكشن مثل Link to comment
</Mr.Tn6eL> Posted June 6, 2016 Share Posted June 6, 2016 ^ كودك خطأ . -- Client Side # addEventHandler( 'onClientResourceStart', resourceRoot, function ( ) triggerServerEvent ( localPlayer, 'getAccount' ) end) addEvent ( 'setAccount', true ) addEventHandler ( 'setAccount', root, function( acc ) guiSetText ( Account, acc ) end) -- Server Side # addEvent ( 'getAccount', true ) addEventHandler ( 'getAccount', root, function ( ) if getPlayerAccount ( client ) and not isGuestAccount ( getPlayerAccount ( client ) ) then triggerClientEvent ( client, 'setAccount', client, getAccountName ( getPlayerAccount ( client ) ) ) end end ) سطر 3 بالكلنت عاكس الدنيا 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