JC-MP

Scripting => Releases => Topic started by: Kesarion on November 06, 2020, 12:10:05 am

Title: Steam id finder
Post by: Kesarion on November 06, 2020, 12:10:05 am
Code: [Select]
--[[ script that will print the steamid of any player
 /steamid numberid  gives the steamid  of the player that has that id
 /mysteamid         gives the players personal steamid
 ]]--
function mysteamid(args)
 local playerthatasked = args.player
 local words = args.text:split(" ")
 if #words == 1 and words[1]== "/mysteamid" then
if IsValid(playerthatasked) then
local ysrmid= "Your STEAM ID is "
local steamfinder2=playerthatasked:GetSteamId().id
playerthatasked:SendChatMessage(ysrmid..tostring(steamfinder2),Color(100, 149, 237))
end
end
end
function steamfinderothers(args)
 local playerthatasked = args.player
 local playertofind
 local words = args.text:split(" ")
if #words == 2 and words[1] == "/steamid" then
for player in Server:GetPlayers() do
if player:GetId()== tonumber(words[2]) then playertofind = player 
end
end
if IsValid(playerthatasked) and IsValid(playertofind) then -- if both players are online
local steamidfinder1=playertofind:GetSteamId().id
local steaminfotxt =" 's STEAM ID is "
playerthatasked:SendChatMessage(tostring(playertofind:GetName())..steaminfotxt..tostring(steamidfinder1), Color(100, 149, 237))
elseif IsValid(playerthatasked) and not IsValid(playertofind) then -- if the target  player is not online
local playernotfoundmessage= "This player is no longer in the game"
playerthatasked:SendChatMessage(playernotfoundmessage, Color( 255,100,100))
return true
end
end
end

Events:Subscribe("PlayerChat",mysteamid)
Events:Subscribe("PlayerChat",steamfinderothers)

Make a folder with the name of the script and a Server folder in witch you will put all of above with .lua ending.
commands:
 /steamid numberid  gives the steamid  of the player that has that id from the F6 menu with the players.This was done because people can use multiple alphabets and special characters.
 /mysteamid         gives the players personal steamid

Pretty simple
I might add images later.