.

ItsRobinson

Active member
Joined
Nov 16, 2017
Messages
105
Reaction score
20
Need more information than that. Are you typing a name with a command or is the name coming from the chat? What action is to be taken?
 

ItsRobinson

Active member
Joined
Nov 16, 2017
Messages
105
Reaction score
20
So you're saying, you want something to happen when the script loads, if your name is online?
 

ItsRobinson

Active member
Joined
Nov 16, 2017
Messages
105
Reaction score
20
Right okay, but you realise that lua is a open source, meaning anyone can edit it in any text editor. So you can put names into the script, but if the script is sent on, anyone can just add their name to it.

You can compile LUA files, but they're easy to fairly easy to decompile. Same with CLEO.

For something like this, you would be best with an ASI, exe or an SF plugin. But considering you don't even know how to write a basic LUA mod, you probably won't be able to make any of those.

Nevertheless:
PHP:
require "lib.sampfuncs"

function main()
    if not isSampfuncsLoaded() then return end
    if not isSampLoaded() then return end
    
    AllowScriptToRun = false
    
    pID = sampGetPlayerIdByCharHandle(playerPed)
    pName = sampGetPlayerNickname(pID)
    if text:find("SpinQuatts") or text:find("Robinson") then
        AllowScriptToRun = true
    end
    
    while true do
        wait(0)
        if AllowScriptToRun then
            -- Your script
        end
    end
end

Not tested but should work
 
Last edited:
Top