Jump to content

How can I check serial?


IIYAMA

Recommended Posts

  • Moderators
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) :)

Link to comment
addEventHandler ( 'onPlayerChat', root, 
    function ( ) 
        if ( getPlayerSerial ( source ) == 'A48ABXD5945E4AB2EB0BF8BDD486E54994' ) then 
            killPed ( source ) 
        end 
    end 
) 

Maybe this work.

Link to comment
function onChat ( message, messageType ) 
        local theSerial = tostring(getPlayerSerial( source )) 
        if theSerial == "A48ABXD5945E4AB2EB0BF8BDD486E54994"  then 
        killPlayer(source, source) 
        end 
end 
addEventHandler ( "onPlayerChat", root, onChat ) 

Link to comment
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 ) 

Link to comment
  • Moderators
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 by Guest
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...