Get player id When he is clicked
#1

I need to know as Get the ID of the Clicked Player (on TAB (players list))

How can i do this?
Reply
#2

Well just use the clickedplayerid in OnPlayerClickPlayer
Reply
#3

pawn Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    new message[32];
    format(message, sizeof(message), "You clicked on player %d", clickedplayerid);
    SendClientMessage(playerid, 0xFFFFFFFF, message);
    return 1;
}
https://sampwiki.blast.hk/wiki/OnPlayerClickPlayer
Reply
#4

You can actually do that by doing the following:

pawn Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source) {
    if(source == CLICK_SOURCE_SCOREBOARD && playerid != clickedplayerid) { //If it comes from the scoreboard and the playerid doesn't equal the clicked playerid
        new msg[128];
        format(msg, sizeof(msg), "You have clicked the following player id: %d", clickedplayerid);
        SendClientMessage(playerid, -1, msg); //Show who you clicked.
    }
    return 1;
}
Reply
#5

no... I ask you get the player id and put the id into a variable...
Reply
#6

Make a new clickPlayer;
Then
pawn Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    clickedPlayer = clickedplayerid;
    return 1;
}
Reply
#7

thx... it was very simple ahahahaha
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)