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)
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.
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.
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 )
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?
drk Posted March 31, 2012 Posted March 31, 2012 index with boolean value "true" as data will be "parsed", "false" will not be "parsed".
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
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.
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