- Initiateur de la discussion
thepsyca
Psychopathe
- Messages
- 2 164
- Score réaction
- 648
- Points
- 365
Bonsoir,
j'ai un problème avec mon code Glua :
Client :
Serveur :
PS : Je sais que l'erreur viens d'ici
j'ai un problème avec mon code Glua :
Les différents codes reliée à la fonction :attempt to concatenate global 'LocalClientName' (a nil value)
Client :
Code:
local PlayerList = vgui.Create( "DListView", frame1 ) PlayerList:Dock( LEFT ) PlayerList:DockMargin( 5, 5, 5, 5 ) PlayerList:SetWidth( 200 ) PlayerList:SetMultiSelect(false) PlayerList:AddColumn("Joueurs en ligne") PlayerList.OnRowSelected = function( PlayerList, line ) DataList:Clear() net.Start("findclientdata") net.WriteString( tostring(PlayerList:GetLine( line ):GetValue( 1 )) ) net.SendToServer(ply)
Code:
--ALL CREDIT FOR THIS COMMAND GOES TO THE ULX TEAM. I PULLED THIS OUT SO THAT I COULD NOT HAVE TO RELY ON ULIB FOR A SINGLE FUNCTION.
function nlf_getUser( target ) if not target then return false end local players = player.GetAll() target = target:lower() local plyMatch -- First, do a full name match in case someone's trying to exploit our target system for _, player in ipairs( players ) do if target == player:Nick():lower() then if not plyMatch then return player else return false end end end for _, player in ipairs( players ) do local nameMatch if player:Nick():lower():find( target, 1, true ) then -- No patterns nameMatch = player end if plyMatch and nameMatch then -- Already have one return false end if nameMatch then plyMatch = nameMatch end end if not plyMatch then return false end return plyMatch
end
net.Receive("findclientdata", function(len, pl) local LocalName = pl:Name() local LocalClientname = net.ReadString() local target_ply = nlf_getUser( LocalClientname ) local LocalClientID64 = target_ply:SteamID64() print(LocalClientName .. " "..LocalClientID64) if file.Exists("nlf/givemoneyonetime/" .. LocalClientID64 .. ".txt", "DATA") then end
end)
seulement aucune idée de comme patch celle-cilocal LocalClientID64 = target_ply:SteamID64()