Your initial suggestion is very redundant and a waste of clientr variable, and the method of finding the player dates back to the GS1 days.
Here's how it's done now, or at least how I do it.
PHP Code:
function onActionServerSide() {
if (params[0] == "getprofile") {
// Find Player Object
with (findplayer(params[0])) {
// Store Data into Temporary Variable
temp.data = {
player.account, player.communityname, player.upgradestatus, clientr.somethingelseofinterest
};
}
// Send Temporary Data back to Client
player.triggerclient(this.name, "profiledata", temp.data);
}
}
//#CLIENTSIDE
function onMouseDown(button) {
if (button == "right") {
temp.pid = testplayer(mousex, mousey);
if (temp.pid > 0) {
getPlayerData(players[temp.pid].account);
}
}
}
function getPlayerData(acct) {
// Request Player Profile Data
triggerserver("gui", name, "getprofile", acct);
}
function onActionClientSide() {
if (params[0] == "profiledata") {
temp.profiledata = params[1];
// Data Handling Code Here
}
}