villr Posted October 2, 2011 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 Happy Owner/Leader of SELS:RPG | Cops and Gangsters | TRUE CRIME CITY with a lot of JOBS! Scripted since summer 2010
Aibo Posted October 2, 2011 Posted October 2, 2011 client-side does't have access to accounts and related functions, obviously. you'll have to use server for that. ?
villr Posted October 2, 2011 Author Posted October 2, 2011 hmm okay but then i need help beacuse idk how i gonna make this server side Happy Owner/Leader of SELS:RPG | Cops and Gangsters | TRUE CRIME CITY with a lot of JOBS! Scripted since summer 2010
BinSlayer1 Posted October 2, 2011 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.
villr Posted October 2, 2011 Author 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 Happy Owner/Leader of SELS:RPG | Cops and Gangsters | TRUE CRIME CITY with a lot of JOBS! Scripted since summer 2010
Al3grab Posted October 2, 2011 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 ) ING : [xXx]~Al3grab
villr Posted October 2, 2011 Author Posted October 2, 2011 solved in another way Happy Owner/Leader of SELS:RPG | Cops and Gangsters | TRUE CRIME CITY with a lot of JOBS! Scripted since summer 2010
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