Moderators IIYAMA Posted March 31, 2012 Moderators Posted March 31, 2012 function onChat ( message, messageType ) local theSerial = getPlayerSerial( source ) if theSerial == "A48ABXD5945E4AB2EB0BF8BDD486E54994" then killPlayer(source, source) end end addEventHandler ( "onPlayerChat", root, onChat ) I tryed this above: I wanna check players their serial. But I don't get an error or something..... if any player in the server write something, he will die.... Only the player with X serial must be killed. (this is just a sample. btw fake serial) Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
drk Posted March 31, 2012 Posted March 31, 2012 addEventHandler ( 'onPlayerChat', root, function ( ) if ( getPlayerSerial ( source ) == 'A48ABXD5945E4AB2EB0BF8BDD486E54994' ) then killPed ( source ) end end ) Maybe this work. EPT Team Server Development: 0% Learning C++ | C++ is amazing
MTA Team qaisjp Posted March 31, 2012 MTA Team Posted March 31, 2012 function onChat ( message, messageType ) local theSerial = tostring(getPlayerSerial( source )) if theSerial == "A48ABXD5945E4AB2EB0BF8BDD486E54994" then killPlayer(source, source) end end addEventHandler ( "onPlayerChat", root, onChat )
drk Posted March 31, 2012 Posted March 31, 2012 Noddy, getPlayerSerial already returns a string. I think you don't need to convert. And killPlayer is deprecated. EPT Team Server Development: 0% Learning C++ | C++ is amazing
Castillo Posted March 31, 2012 Posted March 31, 2012 local serials = { [ "A48ABXD5945E4AB2EB0BF8BDD486E54994" ] = true, } function onChat ( message, messageType ) local theSerial = getPlayerSerial ( source ) if ( serials[ theSerial ] ) then killPed ( source, source ) end end addEventHandler ( "onPlayerChat", root, onChat ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Moderators IIYAMA Posted March 31, 2012 Author Moderators Posted March 31, 2012 ah thx guys = true is this needed? what is the function of it? Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
drk Posted March 31, 2012 Posted March 31, 2012 index with boolean value "true" as data will be "parsed", "false" will not be "parsed". EPT Team Server Development: 0% Learning C++ | C++ is amazing
Moderators IIYAMA Posted March 31, 2012 Author Moderators Posted March 31, 2012 (edited) index with boolean value "true" as data will be "parsed", "false" will not be "parsed". > If I put them at false (arround 3 serial) Than they all need to be correct, bevore the next step? --------------------------------------------------------------------- No. If you put all with false value, will be like there are no serials equal to the player's serial. It has the same result as this? > if not ( getPlayerSerial ( source ) == 'A48ABXD5945E4AB2EB0BF8BDD486E54994' ) then end > Edited April 1, 2012 by Guest Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
drk Posted March 31, 2012 Posted March 31, 2012 No. If you put all with false value, will be like there are no serials equal to the player's serial. EPT Team Server Development: 0% Learning C++ | C++ is amazing
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