villr Posted October 2, 2011 Share Posted October 2, 2011 (edited) code function damageCheck(attacker, weapon) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount(playeraccount) then if getAccountData ( playeraccount, "carshow" ) then if(weapon == 5)then local x, y, z = getElementPosition(getLocalPlayer()) setElementPosition(getLocalPlayer(), x + 20, y + 50, z + 80) else end end end end addEventHandler( "onClientPlayerDamage", getLocalPlayer ( ), damageCheck ) problem client.lua attemp to call globar 'getPlayerAccount' (a nil value somebody can help me the script is when i hit with my basebool bat its only for the peoples with the accountdata 'carshow' that can use it,its for use at carshows like throw out,but i cant get it to work for only them anybody out there that can help me? Edited October 2, 2011 by Guest Link to comment
Aibo Posted October 2, 2011 Share Posted October 2, 2011 client-side does't have access to accounts and related functions, obviously. you'll have to use server for that. Link to comment
villr Posted October 2, 2011 Author Share Posted October 2, 2011 hmm okay but then i need help beacuse idk how i gonna make this server side Link to comment
BinSlayer1 Posted October 2, 2011 Share Posted October 2, 2011 function damageCheck(attacker, weapon) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount(playeraccount) then if getAccountData ( playeraccount, "carshow" ) then if(weapon == 5)then local x, y, z = getElementPosition(source) setElementPosition(source, x + 20, y + 50, z + 80) else end end end end addEventHandler( "onPlayerDamage", getRootElement(), damageCheck ) Just made your script server-side. I have no idea if it works as you intend it to. Link to comment
villr Posted October 2, 2011 Author Share Posted October 2, 2011 function damageCheck(attacker, weapon) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount(playeraccount) then if getAccountData ( playeraccount, "carshow" ) then if(weapon == 5)then local x, y, z = getElementPosition(source) setElementPosition(source, x + 20, y + 50, z + 80) else end end end end addEventHandler( "onPlayerDamage", getRootElement(), damageCheck ) Just made your script server-side. I have no idea if it works as you intend it to. dosent work Link to comment
Al3grab Posted October 2, 2011 Share Posted October 2, 2011 --client function damageCheck(attacker, weapon) local playeraccount = getPlayerAccount ( source ) if ( getElementData(getLocalPlayer(),"carshow") == true ) then if(weapon == 5)then local x, y, z = getElementPosition(getLocalPlayer()) setElementPosition(getLocalPlayer(), x + 20, y + 50, z + 80) end end end addEventHandler( "onClientPlayerDamage", getLocalPlayer ( ), damageCheck ) --server addEventHandler("onPlayerLogin",root, function() local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount(playeraccount) then if ( getAccountData ( playeraccount, "carshow" ) == true ) then setElementData(source,"carshow",true) end end end ) Link to comment
villr Posted October 2, 2011 Author Share Posted October 2, 2011 solved in another way 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