Extended Clients Li...
 
Notifications
Clear all

Extended Clients List C++/SPRX

Page 1 / 2

KranK
Posts: 336
Topic starter
(@KranK)
Reputable Member
Joined: 9 years ago

Hey Rivals

This is Little Function i have Made to Extend Player List Show

1.Shows Players
2.Say If player is Host
3.Say If Player Is Host and Friend
4.Determines your Player
5.Determines your Player and if you host

if you have any ideas to add to this let me know !

[HIDE]Is player Friend Function

	bool Is_Player_Friend(Player player)
	{
	    bool BplayerFriend = false;
	    bool bplayerFriend = false;
	    int handle[76];
	    NETWORK::NETWORK_HANDLE_FROM_PLAYER(player, &handle[0], 13);
	    if (NETWORK::NETWORK_IS_HANDLE_VALID(&handle[0], 13))
	    {
	        BplayerFriend = NETWORK::NETWORK_IS_FRIEND(&handle[0]);
	    }
	    if (BplayerFriend)
	        bplayerFriend = true;
	    else
	        bplayerFriend = false;
	
	    return bplayerFriend;
	}
	

Client List Function

	#pragma region Players List
	    case Players_List:
	        addTitle("Players List");
	        for (int i = 0; i < 18; i++)
	        {
	            char * Name = PLAYER::GET_PLAYER_NAME(i);
	            char NameBuffer[30];
	            //if host and Friend
	            if (i == NETWORK::NETWORK_GET_HOST_OF_SCRIPT("freemode", -1, 0) && Is_Player_Friend(i) == true)
	            {
	                sprintf(NameBuffer, "~b~[HOST/FRIEND] %s", Name);
	                Name = NameBuffer;
	                addOption(Name);
	
	            }
	            //if friend
	            else if (Is_Player_Friend(i) == true)
	            {
	                sprintf(NameBuffer, "~g~[FRIEND] %s", Name);
	                Name = NameBuffer;
	                addOption(Name);
	            }
	            //if host and you
	            else if (i == NETWORK::NETWORK_GET_HOST_OF_SCRIPT("freemode", -1, 0) && PLAYER::GET_PLAYER_PED(i) == PLAYER::PLAYER_PED_ID())
	            {
	                sprintf(NameBuffer, "~h~~o~รท[HOST] %s", Name);
	                Name = NameBuffer;
	                addOption(Name);
	            }
	            //if host only
	            else if (i == NETWORK::NETWORK_GET_HOST_OF_SCRIPT("freemode", -1, 0))
	            {
	                sprintf(NameBuffer, "~r~[HOST] %s", Name);
	                Name = NameBuffer;
	                addOption(Name);
	            }
	            //if you only
	            else if (PLAYER::GET_PLAYER_PED(i) == PLAYER::PLAYER_PED_ID())
	            {
	                sprintf(NameBuffer, "~h~~o~รท %s", Name);
	                Name = NameBuffer;
	                addOption(Name);
	            }
	            // all other xD
	            else
	            {
	                addOption(Name);
	            }
	
	
	
	        }
	        if (optionPress && PLAYER::IS_PLAYER_PLAYING(currentOption - 1))
	        {
	            selectedPlayer = currentOption - 1;
	            changeSubmenu(Player_Options);
	
	        }
	        break;
	#pragma endregion
	

[/HIDE]

Reply
Name of the Video Game, and any other Tags
7 Replies
Cain532
Posts: 1280
(@cain532)
Noble Member
Joined: 10 years ago
Reply
KranK
Posts: 336
Topic starter
(@KranK)
Reputable Member
Joined: 9 years ago

Nice Post Kranky!

Yes Sir thats what we do , we do nice things ๐Ÿ˜›

Reply
LEGACYY
Posts: 2350
(@legacyy)
Noble Member
Joined: 9 years ago

Grand Master KranK back at it with GTA (y)

Reply
Rivalz
Posts: 307
(@Rivalz)
Reputable Member
Joined: 9 years ago

Excellent post, thank you for sharing. ๐Ÿ˜‰

Reply
Page 1 / 2