Results 1 to 3 of 3
  1. #1
    kingboy111's Avatar
    Join Date
    Dec 2013
    Gender
    male
    Posts
    129
    Reputation
    10
    Thanks
    103
    My Mood
    Sneaky

    GetFriendStatus struggle

    Hello,

    Recently, I have tried to learn Lua, and I am currently creating a cheat for gmod. I am trying to use GetFriendStatus in order to determine who's my friend, blocked, requested, or in no relationship with me at all.

    Code:
    surface.CreateFont("Casual",{ font = "TabLarge", size = 16, weight = 700, outline = true })
    
    local function MESPCheck(v)
    	if v:Alive() == true and v:Health() ~= 0 and v:Health() > 0 and v ~= LocalPlayer() and LocalPlayer():Alive() then
    		return true
    	else
    		return false
    	end
    end
    
    --[Health & Name ESP]--
    
    CreateClientConVar("esp", 1, true, false)
    hook.Add("HUDPaint", "ESP", function()
    	for k,v in pairs( player.GetAll() ) do
    		if GetConVarNumber("esp") == 1 then
    			if MESPCheck(v) and v:Team() ~= TEAM_SPECTATOR and v:Team() ~= TEAM_UNASSIGNED then
    				local Pos = v:GetPos():ToScreen()
    				draw.DrawText( "Health: "..v:Health(), "Casual", Pos.x, Pos.y + 18, Color( 255, 255, 255, 255), 1 ); 
    				draw.DrawText( v:SteamID(), "Casual", Pos.x, Pos.y + 36, Color( 255, 255, 255, 255), 1 );
    				print( v:GetFriendStatus() )
    					if v:GetFriendStatus == "none" or v:GetFriendStatus == "requested" then
    						draw.DrawText( v:Name(), "Casual", Pos.x, Pos.y, Color( 254, 247, 117, 255 ), 1 );
    					end		
    			end
    		end
    	end
    end)
    What I'm trying to do is print the relationship status of all the current players in the server, to then determine the color of my name esp. However, when I test this out, it says that on line 22,
    Code:
    if v:GetFriendStatus == "none" or v:GetFriendStatus == "requested" then
    that the function arguments near '==':

    Code:
    [ERROR] lua/unnamed.lua:22: function arguments expected near '=='
      1. unknown - lua/unnamed.lua:0

    What's the reasoning behind this? What am I doing wrong? I know, I know, I am garbage at coding. If there's another, preferably easier way to execute what I am trying to do, please let me know as well.

    Thanks.
    Last edited by kingboy111; 04-05-2014 at 12:39 PM.

  2. #2
    kingboy111's Avatar
    Join Date
    Dec 2013
    Gender
    male
    Posts
    129
    Reputation
    10
    Thanks
    103
    My Mood
    Sneaky
    Never mind, I have gotten this to work.

    I forgot to put the parentheses after v:GetFriendStatus (so in this case, v:GetFriendStatus()).

  3. #3
    Gray's Avatar
    Join Date
    Nov 2012
    Gender
    male
    Location
    Sweden
    Posts
    13,557
    Reputation
    2516
    Thanks
    10,618
    Solved.
    Closed.

Similar Threads

  1. [Detected] Baraozin Eternal struggle v3.0 ->Agora em WIN 7<-
    By baraozin in forum Combat Arms Brazil Hacks
    Replies: 81
    Last Post: 08-16-2011, 06:52 PM
  2. [Detected] Baraozin Eternal Struggle v2.0 ->Apenas Atualizado<-
    By baraozin in forum Combat Arms Brazil Hacks
    Replies: 29
    Last Post: 08-13-2011, 12:47 PM
  3. [Solved] Problema com o Baraoz1n Eternal Struggle
    By GiroGun in forum Combat Arms Brazil Help
    Replies: 8
    Last Post: 08-10-2011, 08:40 PM
  4. [Detected] Baraozin Eternal Struggle v1.0 ->NOVIDADES<-
    By baraozin in forum Combat Arms Brazil Hacks
    Replies: 101
    Last Post: 08-10-2011, 03:01 PM
  5. Crysis Power Struggle
    By arunforce in forum General
    Replies: 3
    Last Post: 09-27-2007, 01:13 PM