Any ideas on how i could go about a black list menu? where there are empty slots, and clicking on one opens player list so you can select a player to place in said black list?..
Just finished this up last night. nothing crazy. haven't tested myself but a friend has after i implemented in my menu. so far so good. let me know if anyone has a better way. #edit tested myself, saves name fine. but when clicking name to kick it doesn't. will fix.
Code:
/////////////////////////////////
#pragma region BLACK_LIST_CHOOSING
case BLACK_LIST_CHOOSING:
SubTitle("BLACK LIST", 1);
for (int i = 0; i < 16; i++)
{
char* pName = PLAYER::GET_PLAYER_NAME(i);
if (!NETWORK::NETWORK_IS_PLAYER_CONNECTED(i))
{
AddOption(PLAYER::GET_PLAYER_NAME(i), "~r~No Client Connected");
}
else
{
AddOption(PLAYER::GET_PLAYER_NAME(i), "Select a Client To Save in The Black List");
}
if (i == currentOption - 1)
{
}
}
if (optionPress && PLAYER::IS_PLAYER_PLAYING(currentOption - 1))
{
char* Name = PLAYER::GET_PLAYER_NAME(selectedPlayer);
selectedPlayer = currentOption - 1;
SavePlayerNameForBlackList(selectedPlayer);
ShowMessageWithName(Name, "Saved In BlackList.");
}
for (int i = 16; i < 18; i++)
{
char* pName = PLAYER::GET_PLAYER_NAME(i);
char* playerName;
char* info;
if (GAMEPLAY::ARE_STRINGS_EQUAL(pName, "**Invalid**"))
{
playerName = AddStrings("~r~No Client", " ~y~[SCTV]");
info = "There is No Client Connected in Ths Slot.";
}
else
{
playerName = AddStrings(pName, " ~y~[SCTV]");
info = "Select a Client To Save in The Black List";
}
AddOption(playerName, info);
if (currentOption == optionCount)
{
if (optionPress && PLAYER::IS_PLAYER_PLAYING(i))
{
char* Name = PLAYER::GET_PLAYER_NAME(selectedPlayer);
SavePlayerNameForBlackList(selectedPlayer);
ShowMessageWithName(Name, "Saved In BlackList.");
}
selectedPlayer = ((i)-1);
}
}
break;
#pragma endregion
#pragma region BLACK_LIST
case BLACK_LIST:
SubTitle("BLACK LIST", 1);
AddBlackListName(SavedName, "Click on Client to Kick, if that Doesn't work We'll Crash them. ~b~[MOST MODDERS CAN STOP THIS]");
break;
#pragma endregion
////////////////////////////////////
#pragma region TESTING AREA
void SavePlayerNameForBlackList(Player player)
{
char* Client = PLAYER::GET_PLAYER_NAME(player);
SavedName = Client;
}
void AddBlackListName(char *option, char *info = NULL)
{
SavedName = option;
AddOption(option);
if (currentOption == optionCount)
{
xInstruction = true;
if (optionPress && (SavedName = "Empty"))
{
ChangeSubmenu(BLACK_LIST_CHOOSING);
}
else if (optionPress && (SavedName))
{
NETWORK::NETWORK_SESSION_KICK_PLAYER(selectedPlayer);
int Args[3];
Args[0] = 2;
Args[1] = selectedPlayer;
Args[2] = 0x35;
TriggerScriptEvent(Args, 3, selectedPlayer);
if (NETWORK::NETWORK_IS_PLAYER_CONNECTED(selectedPlayer))
{
JetsCrash();
RainTrailers();
}
else if (!NETWORK::NETWORK_IS_PLAYER_CONNECTED(selectedPlayer))
{
}
}
}
}
#pragma endregion
/////////////////////////////////////
char* SavedName = "Empty"; //BlackList testing
Nice players list from united x
(12-19-2018 - 06:55 PM)XBLxPhantom Wrote: Just finished this up last night. nothing crazy. haven't tested myself but a friend has after i implemented in my menu. so far so good. let me know if anyone has a better way. #edit tested myself, saves name fine. but when clicking name to kick it doesn't. will fix.
Code://///////////////////////////////
#pragma region BLACK_LIST_CHOOSING
case BLACK_LIST_CHOOSING:
SubTitle("BLACK LIST", 1);
for (int i = 0; i < 16; i++)
{
char* pName = PLAYER::GET_PLAYER_NAME(i);
if (!NETWORK::NETWORK_IS_PLAYER_CONNECTED(i))
{
AddOption(PLAYER::GET_PLAYER_NAME(i), "~r~No Client Connected");
}
else
{
AddOption(PLAYER::GET_PLAYER_NAME(i), "Select a Client To Save in The Black List");
}
if (i == currentOption - 1)
{
}
}
if (optionPress && PLAYER::IS_PLAYER_PLAYING(currentOption - 1))
{
char* Name = PLAYER::GET_PLAYER_NAME(selectedPlayer);
selectedPlayer = currentOption - 1;
SavePlayerNameForBlackList(selectedPlayer);
ShowMessageWithName(Name, "Saved In BlackList.");
}
for (int i = 16; i < 18; i++)
{
char* pName = PLAYER::GET_PLAYER_NAME(i);
char* playerName;
char* info;
if (GAMEPLAY::ARE_STRINGS_EQUAL(pName, "**Invalid**"))
{
playerName = AddStrings("~r~No Client", " ~y~[SCTV]");
info = "There is No Client Connected in Ths Slot.";
}
else
{
playerName = AddStrings(pName, " ~y~[SCTV]");
info = "Select a Client To Save in The Black List";
}
AddOption(playerName, info);
if (currentOption == optionCount)
{
if (optionPress && PLAYER::IS_PLAYER_PLAYING(i))
{
char* Name = PLAYER::GET_PLAYER_NAME(selectedPlayer);
SavePlayerNameForBlackList(selectedPlayer);
ShowMessageWithName(Name, "Saved In BlackList.");
}
selectedPlayer = ((i)-1);
}
}
break;
#pragma endregion
#pragma region BLACK_LIST
case BLACK_LIST:
SubTitle("BLACK LIST", 1);
AddBlackListName(SavedName, "Click on Client to Kick, if that Doesn't work We'll Crash them. ~b~[MOST MODDERS CAN STOP THIS]");
break;
#pragma endregion
////////////////////////////////////
#pragma region TESTING AREA
void SavePlayerNameForBlackList(Player player)
{
char* Client = PLAYER::GET_PLAYER_NAME(player);
SavedName = Client;
}
void AddBlackListName(char *option, char *info = NULL)
{
SavedName = option;
AddOption(option);
if (currentOption == optionCount)
{
xInstruction = true;
if (optionPress && (SavedName = "Empty"))
{
ChangeSubmenu(BLACK_LIST_CHOOSING);
}
else if (optionPress && (SavedName))
{
NETWORK::NETWORK_SESSION_KICK_PLAYER(selectedPlayer);
int Args[3];
Args[0] = 2;
Args[1] = selectedPlayer;
Args[2] = 0x35;
TriggerScriptEvent(Args, 3, selectedPlayer);
if (NETWORK::NETWORK_IS_PLAYER_CONNECTED(selectedPlayer))
{
JetsCrash();
RainTrailers();
}
else if (!NETWORK::NETWORK_IS_PLAYER_CONNECTED(selectedPlayer))
{
}
}
}
}
#pragma endregion
/////////////////////////////////////
char* SavedName = "Empty"; //BlackList testing
lit ma dude
#CelestialFTW
(12-20-2018 - 04:10 PM)PhucedMODZ Wrote: Nice players list from united x
I wouldn't say nice, i found it kinda garbage just haven't gotten to changing it.
(12-20-2018 - 05:26 PM)Niqqie Wrote:(12-20-2018 - 04:10 PM)PhucedMODZ Wrote: Nice players list from united x
You are gonna have to get over it, it is a very old verion on UX, leachers gonna leach.
"leechers gonna leech" yet I'm posting something I'm making for others...hmmm how am i leaching? atleast i don't sell menus with 90% of someone elses code :/ my shit's free to anyone chill enough to test it and not leak before i release the finished xex. and when it's finished it'll still be free lmao.
Yeah I know that lmao, when I get round to updating UX I might make some features like this, but make it so it stores the players in the db
Users browsing: 1 Guest(s)