ALERT!
Click here to register with a few steps and explore all our cool stuff we have to offer!
Home
Upgrade
Credits
Help
Search
Awards
Achievements
 2170

Playerlist Question ??

by Torxi - 06-12-2019 - 08:41 AM
#1
My game lag when I open the player list, can I fix it with the sleep functions?

Thanks for Help, Peace !!
Reply
#2
need show codes for view problem
This account is currently banned
Ban reason: Leeching and Spamming is not allowed, please read the forum Rules upon your return.
Reply
#3
show code to help u
Reply
#4
I am finally back home tonight, stupid work in another city. I will then the code post, ever thanks for the help
Reply
#5
(06-12-2019 - 12:19 PM)NoNameV2345 Wrote: need show codes for view problem

#pragma region //PLAYERS LIST
    case Players_List:
        addTitle("Player List");
        for (int i = 0; i < 18; i++)
        {
            char *hostName = ReadString((*(int*)0x1CF72C4) + 0x10);
            char *playerName = PLAYER::GET_PLAYER_NAME(i);
            char NameBufferH[50];
            char NameBufferY[50];
            char NameBufferZ[50];
            if (i == NETWORK::NETWORK_GET_HOST_OF_SCRIPT("freemode", -1, 0)) {
                sprintf(NameBufferH, "%s   ~HUD_COLOUR_YELLOW~HOST", PLAYER::GET_PLAYER_NAME(i));
                addOption(NameBufferH);
            }
            else if (PLAYER::GET_PLAYER_PED(i) == PLAYER_PED_ID()) {
                sprintf(NameBufferY, "%s   ~HUD_COLOUR_SOCIAL_CLUB~ICH", PLAYER::GET_PLAYER_NAME(i));
                addOption(NameBufferY);
            }
            else if (Is_Player_Friend(i) == true)
            {
                sprintf(NameBufferZ, "%s   ~HUD_COLOUR_PURPLELIGHT~FREUND ", PLAYER::GET_PLAYER_NAME(i));

                addOption(NameBufferZ);
            }
            else
                addOption(PLAYER::GET_PLAYER_NAME(i));
        }
        if (optionPress && PLAYER::IS_PLAYER_PLAYING(currentOption - 1))
        {
            selectedPlayer = currentOption - 1;
            changeSubmenu(Player_Options);
        }
        playerinfo(0);
        break;
#pragma endregion
Reply
#6
(06-14-2019 - 09:13 PM)Torxi Wrote:
(06-12-2019 - 12:19 PM)NoNameV2345 Wrote: need show codes for view problem

#pragma region //PLAYERS LIST
    case Players_List:
        addTitle("Player List");
        for (int i = 0; i < 18; i++)
        {
            char *hostName = ReadString((*(int*)0x1CF72C4) + 0x10);
            char *playerName = PLAYER::GET_PLAYER_NAME(i);
            char NameBufferH[50];
            char NameBufferY[50];
            char NameBufferZ[50];
            if (i == NETWORK::NETWORK_GET_HOST_OF_SCRIPT("freemode", -1, 0)) {
                sprintf(NameBufferH, "%s   ~HUD_COLOUR_YELLOW~HOST", PLAYER::GET_PLAYER_NAME(i));
                addOption(NameBufferH);
            }
            else if (PLAYER::GET_PLAYER_PED(i) == PLAYER_PED_ID()) {
                sprintf(NameBufferY, "%s   ~HUD_COLOUR_SOCIAL_CLUB~ICH", PLAYER::GET_PLAYER_NAME(i));
                addOption(NameBufferY);
            }
            else if (Is_Player_Friend(i) == true)
            {
                sprintf(NameBufferZ, "%s   ~HUD_COLOUR_PURPLELIGHT~FREUND ", PLAYER::GET_PLAYER_NAME(i));

                addOption(NameBufferZ);
            }
            else
                addOption(PLAYER::GET_PLAYER_NAME(i));
        }
        if (optionPress && PLAYER::IS_PLAYER_PLAYING(currentOption - 1))
        {
            selectedPlayer = currentOption - 1;
            changeSubmenu(Player_Options);
        }
        playerinfo(0);
        break;
#pragma endregion

Code:
#pragma region //PLAYERS LIST
char PlayersList[140][5];
   case Players_List:
       addTitle("Player List");
       for (int i = 0; i < 18; i++)
       {
            //char *hostName = ReadString((*(int*)0x1CF72C4) + 0x10);
            //char *playerName = PLAYER::GET_PLAYER_NAME(i);
            //char NameBufferH[50];
            //char NameBufferY[50];
            //char NameBufferZ[50];
           if (i == NETWORK::NETWORK_GET_HOST_OF_SCRIPT("freemode", -1, 0)) {
               sprintf(PlayersList[0], "%s   ~HUD_COLOUR_YELLOW~HOST", PLAYER::GET_PLAYER_NAME(i));
               addOption(PlayersList[0]);
           }
           else if (PLAYER::GET_PLAYER_PED(i) == PLAYER_PED_ID()) {
               sprintf(PlayersList[1], "%s   ~HUD_COLOUR_SOCIAL_CLUB~ICH", PLAYER::GET_PLAYER_NAME(i));
               addOption(PlayersList[1]);
           }
           else if (Is_Player_Friend(i) == true)
           {
               sprintf(PlayersList[2], "%s   ~HUD_COLOUR_PURPLELIGHT~FREUND ", PLAYER::GET_PLAYER_NAME(i));

               addOption(PlayersList[2]);
           }
           else
               addOption(PLAYER::GET_PLAYER_NAME(i));
       }
       if (optionPress && PLAYER::IS_PLAYER_PLAYING(currentOption - 1))
       {
           selectedPlayer = currentOption - 1;
           changeSubmenu(Player_Options);
       }
        //playerinfo(0); if not freezes, the problem it's this
       break;
#pragma endregion
This account is currently banned
Ban reason: Leeching and Spamming is not allowed, please read the forum Rules upon your return.
Reply
#7
Thank you, then I'll try how I can use the playerinfo the best
Reply
#8
(06-14-2019 - 11:14 PM)Torxi Wrote: Thank you, then I'll try how I can use the playerinfo the best

Show code player info if you want
This account is currently banned
Ban reason: Leeching and Spamming is not allowed, please read the forum Rules upon your return.
Reply
#9
#pragma region MENU PLAYER INFOS
void playerinfo(bool SelectPlayer) // Put your Player Info Here int SelectPlayer
{

LPCSTR weapnamep; Hash weap;
Player ui_currentPlayer = currentOption - 1;
Player ui_slectedPlayer = selectedPlayer; // Ok
Player OnlinePlayer = PLAYER::GET_PLAYER_PED(SelectPlayer ? ui_currentPlayer : ui_slectedPlayer);
Vector3 Coords = ENTITY::GET_ENTITY_COORDS(OnlinePlayer, 1);
char wanted[50], DeadOrAlive[50], Rank[50], MutedMe[50], modmenu[50], invincible[50]; // IsArmed[50],

float menuPos = 0.675f; //0.658f //38
drawText(PLAYER::GET_PLAYER_NAME(SelectPlayer ? ui_currentPlayer : ui_slectedPlayer), 4, 0.658f, -0.038f, 0.65f, 0.090f, 255, 255, 255, bannerTextOpacity, true);
sprintf(invincible, "%s", PLAYER::GET_PLAYER_INVINCIBLE(SelectPlayer ? ui_currentPlayer : ui_slectedPlayer) ? "~HUD_COLOUR_SOCIAL_CLUB~Godmode " : "kein Modder");
sprintf(MutedMe, "%s", NETWORK::NETWORK_AM_I_MUTED_BY_PLAYER(OnlinePlayer) ? "~HUD_COLOUR_SOCIAL_CLUB~Muted" : "~w~Not Muted");
sprintf(Rank, "Lvl: ~HUD_COLOUR_SOCIAL_CLUB~%i", getPlayerRank(SelectPlayer ? ui_currentPlayer : ui_slectedPlayer));
sprintf(DeadOrAlive, "%s", PED::_IS_PED_DEAD(OnlinePlayer, 1) ? "~HUD_COLOUR_WAYPOINT~Dead" : "~HUD_COLOUR_SOCIAL_CLUB~Alive");
snprintf(wanted, sizeof(wanted), "~w~Stars: ~HUD_COLOUR_SOCIAL_CLUB~%i", (int)PLAYER::GET_PLAYER_WANTED_LEVEL(SelectPlayer ? ui_currentPlayer : ui_slectedPlayer));
// ~y~DAS IST DAS NEUE
int KD = Read_Global(1581972 + (306 * ui_currentPlayer));
float KD_Float = ItoF(KD);
char * KD_String = FtoS(KD_Float);
char KD_buf[90];
snprintf(KD_buf, sizeof(KD_buf), "KD: ~HUD_COLOUR_SOCIAL_CLUB~%s", KD_String);
char*Health[50];
if (ENTITY::DOES_ENTITY_EXIST(PLAYER::GET_PLAYER_PED(SelectPlayer)))
{
//text
Vector3 myCoords = GET_ENTITY_COORDS(PLAYER_PED_ID(), 1);
Vector3 Coords = GET_ENTITY_COORDS(PLAYER::GET_PLAYER_PED(SelectPlayer ? ui_currentPlayer : ui_slectedPlayer - 1), 1);
int health = ENTITY::GET_ENTITY_HEALTH(PLAYER::GET_PLAYER_PED(SelectPlayer ? ui_currentPlayer : ui_slectedPlayer - 1));

int Distance = GAMEPLAY::GET_DISTANCE_BETWEEN_COORDS(myCoords.x, myCoords.y, myCoords.z, Coords.x, Coords.y, Coords.z, 0);
int car = GET_VEHICLE_PED_IS_IN(PLAYER::GET_PLAYER_PED(SelectPlayer ? ui_currentPlayer : ui_slectedPlayer - 1), 0);
int ISVehicle = PED::IS_PED_IN_VEHICLE(PLAYER::GET_PLAYER_PED(SelectPlayer ? ui_currentPlayer : ui_slectedPlayer - 1), car, 1);
int street = 0;
float speed = ENTITY::GET_ENTITY_SPEED(PLAYER::GET_PLAYER_PED(SelectPlayer ? ui_currentPlayer : ui_slectedPlayer - 1));
int convertedspeed = (int)speed;
char healthtext[65];

char speedtext[65];
char vehicletext[65];
char distancetext[65];
char Autotext[65];
char GUNtext[65];
char* NameCar;
char Health[50];
int PlayerVehicle = PED::GET_VEHICLE_PED_IS_IN(PLAYER::GET_PLAYER_PED(SelectPlayer), true);
if (PED::IS_PED_IN_ANY_VEHICLE(PLAYER::GET_PLAYER_PED(SelectPlayer), true)) { NameCar = UI::_0x95C4B5AD(VEHICLE::GET_DISPLAY_NAME_FROM_VEHICLE_MODEL(ENTITY::GET_ENTITY_MODEL(PlayerVehicle))); }// PlayerVehicle
else { NameCar = "Kein Auto"; }

WEAPON::GET_CURRENT_PED_WEAPON(PLAYER::GET_PLAYER_PED(SelectPlayer), &weap, 1);
GET_WEAPON_NAME(weap, weapnamep);
sprintf(Health, "Health: ~HUD_COLOUR_SOCIAL_CLUB~ %d / 328", ENTITY::GET_ENTITY_HEALTH(OnlinePlayer), GET_ENTITY_MAX_HEALTH(OnlinePlayer)); // Neu
char crewnmae[500];
char Money[50];
snprintf(Money, sizeof(Money), "Money: ~HUD_COLOUR_SOCIAL_CLUB~%i", (int)getCash(SelectPlayer ? ui_currentPlayer : ui_slectedPlayer));
sprintf(vehicletext, "In Vehicle: ~HUD_COLOUR_SOCIAL_CLUB~ %d", ISVehicle);
sprintf(speedtext, "Speed: ~HUD_COLOUR_SOCIAL_CLUB~ %d", convertedspeed);
sprintf(distancetext, "Distanz: ~HUD_COLOUR_SOCIAL_CLUB~%d", Distance);
sprintf(Autotext, "Car: ~HUD_COLOUR_SOCIAL_CLUB~ %s", NameCar);
sprintf(GUNtext, "Gun: ~HUD_COLOUR_SOCIAL_CLUB~ %s", weapnamep);
sprintf(crewnmae, "~w~Crew: ~HUD_COLOUR_SOCIAL_CLUB~ %s", getPlayerCrewName(SelectPlayer));

setupdraw();
UI::SET_TEXT_FONT(6);
UI::SET_TEXT_SCALE(0.45f, 0.45f);
UI::SET_TEXT_COLOUR(255, 255, 255, 255);
UI::SET_TEXT_CENTRE(0);
drawstring(Health, -0.038f + menuPos, 0.119f);

setupdraw();
UI::SET_TEXT_FONT(6);
UI::SET_TEXT_SCALE(0.45f, 0.45f);
UI::SET_TEXT_COLOUR(255, 255, 255, 255);
UI::SET_TEXT_CENTRE(0);
drawstring(Money, -0.038f + menuPos, 0.140f);

setupdraw();
UI::SET_TEXT_FONT(6);
UI::SET_TEXT_SCALE(0.45f, 0.45f);
UI::SET_TEXT_COLOUR(255, 255, 255, 255);
UI::SET_TEXT_CENTRE(0);
drawstring(KD_buf, -0.038f + menuPos, 0.161f);

setupdraw();
UI::SET_TEXT_FONT(6);
UI::SET_TEXT_SCALE(0.45f, 0.45f);
UI::SET_TEXT_COLOUR(255, 255, 255, 255);
UI::SET_TEXT_CENTRE(0);
drawstring(Rank, -0.038f + menuPos, 0.182f);

setupdraw();
UI::SET_TEXT_FONT(6);
UI::SET_TEXT_SCALE(0.45f, 0.45f);
UI::SET_TEXT_COLOUR(255, 255, 255, 255);
UI::SET_TEXT_CENTRE(0);
drawstring(GUNtext, -0.038f + menuPos, 0.203f);

setupdraw();
UI::SET_TEXT_FONT(6);
UI::SET_TEXT_SCALE(0.45f, 0.45f);
UI::SET_TEXT_COLOUR(255, 255, 255, 255);
UI::SET_TEXT_CENTRE(0);
drawstring(wanted, -0.038f + menuPos, 0.224f);

setupdraw();
UI::SET_TEXT_FONT(6);
UI::SET_TEXT_SCALE(0.45f, 0.45f);
UI::SET_TEXT_COLOUR(255, 255, 255, 255);
UI::SET_TEXT_CENTRE(0);
drawstring(DeadOrAlive, -0.038f + menuPos, 0.245f);

setupdraw();
UI::SET_TEXT_FONT(6);
UI::SET_TEXT_SCALE(0.45f, 0.45f);
UI::SET_TEXT_COLOUR(255, 255, 255, 255);
UI::SET_TEXT_CENTRE(0);
drawstring(distancetext, -0.038f + menuPos, 0.266f);

setupdraw();
UI::SET_TEXT_FONT(6);
UI::SET_TEXT_SCALE(0.45f, 0.45f);
UI::SET_TEXT_COLOUR(255, 255, 255, 255);
UI::SET_TEXT_CENTRE(0);
drawstring(invincible, -0.038f + menuPos, 0.287f);

setupdraw();
UI::SET_TEXT_FONT(6);
UI::SET_TEXT_SCALE(0.45f, 0.45f);
UI::SET_TEXT_COLOUR(255, 255, 255, 255);
UI::SET_TEXT_CENTRE(0);
drawstring(!strcmp(speedtext, "Speed: ~HUD_COLOUR_SOCIAL_CLUB~ 1") ? (char *)"Speed: ~HUD_COLOUR_SOCIAL_CLUB~ Walk" : !strcmp(speedtext, "Speed: ~HUD_COLOUR_WAYPOINT~ 0") ? (char *)"Speed: ~HUD_COLOUR_WAYPOINT~ Idle" : speedtext, -0.038f + menuPos, 0.308f);

setupdraw();
UI::SET_TEXT_FONT(6);
UI::SET_TEXT_SCALE(0.45f, 0.45f);
UI::SET_TEXT_COLOUR(255, 255, 255, 255);
UI::SET_TEXT_CENTRE(0);
drawstring(Autotext, -0.038f + menuPos, 0.329f);

setupdraw();
UI::SET_TEXT_FONT(6);
UI::SET_TEXT_SCALE(0.45f, 0.45f);
UI::SET_TEXT_COLOUR(255, 255, 255, 255);
UI::SET_TEXT_CENTRE(0);
drawstring(crewnmae, -0.038f + menuPos, 0.350f);

// L+R H+R lang
GRAPHICS::DRAW_RECT(-0.008f + 0.686f, 0.270f, 0.1f, 0.30f, 16, 16, 16, backgroundOpacity); // Back Ground 2735 NEUE 0.638f, 0.3590, 0.1f, 0.41f,
}
}
Reply
#10
Oh damn  Think
Should add a check if the player has connected.
Reply

Users browsing: 1 Guest(s)