onplayerclickplayer
#1

PHP код:
public OnPlayerClickPlayer(playeridclickedplayeridsource)
{
    
showstats(clickedplayerid);
    return 
1;

PHP код:
stock showstats(clickedplayerid)
{
         new 
iString[2000];
         
format (iStringsizeof(iString), "{CECEF6}(INFO) You are viewing %s's stats"PlayerName[clickedplayerid]);
         
SendClientMessage(clickedplayerid, -1iString);
         
format(iString,sizeof(iString),"{FCAE9D}Score: {FFFFFF}%i {FCAE9D}| Level: {FFFFFF}%i {FCAE9D}| Duels Won: {FFFFFF}%i {FCAE9D}| Duels Lost: {FFFFFF}%i"pInfo[clickedplayerid][Score], pInfo[clickedplayerid][Level], pInfo[clickedplayerid][DuelsWin], pInfo[clickedplayerid][DuelsLost]);
         
SendClientMessage(clickedplayerid, -1iString);
          
format(iString,sizeof(iString),"{FCAE9D}Total Points: {FFFFFF}%i {FCAE9D}| Total Respect: {FFFFFF}%i {FCAE9D}| Total Kills: {FFFFFF}%i {FCAE9D}| Total Deaths: {FFFFFF}%i"pInfo[clickedplayerid][Points], pInfo[clickedplayerid][Respect], pInfo[clickedplayerid][Kills],pInfo[clickedplayerid][Deaths]);
         
SendClientMessage(clickedplayerid, -1iString);
         
format(iString,sizeof(iString),"{FCAE9D}Current Kills: {FFFFFF}%i {FCAE9D}| Current Deaths: {FFFFFF}%i {FCAE9D}| Ratio: {FFFFFF}%.2f"PlayerKills[clickedplayerid], PlayerDeaths[clickedplayerid], floatdiv(PlayerKills[clickedplayerid], PlayerDeaths[clickedplayerid]));
         
SendClientMessage(clickedplayerid, -1iString);
         
format(iString,sizeof(iString),"{FCAE9D}Headshots: {FFFFFF}%i"pInfo[clickedplayerid][Headshots]);
         
SendClientMessage(clickedplayerid, -1iString);
          return 
1;

Doesn't work properly, what's wrong?
Reply
#2

showstats(clickedplayerid); ? like RogueDrifter said u need another params for second player, which will see the stats.
Reply
#3

well i did what you said

PHP код:
stock showstats(playeridclickedplayerid)
{
         new 
iString[2000];
         
format (iStringsizeof(iString), "{CECEF6}(INFO) You are viewing %s's stats"PlayerName[playerid]);
         
SendClientMessage(clickedplayerid, -1iString);
         
format(iString,sizeof(iString),"{FCAE9D}Score: {FFFFFF}%i {FCAE9D}| Level: {FFFFFF}%i {FCAE9D}| Duels Won: {FFFFFF}%i {FCAE9D}| Duels Lost: {FFFFFF}%i"pInfo[playerid][Score], pInfo[playerid][Level], pInfo[playerid][DuelsWin], pInfo[playerid][DuelsLost]);
         
SendClientMessage(clickedplayerid, -1iString);
          
format(iString,sizeof(iString),"{FCAE9D}Total Points: {FFFFFF}%i {FCAE9D}| Total Respect: {FFFFFF}%i {FCAE9D}| Total Kills: {FFFFFF}%i {FCAE9D}| Total Deaths: {FFFFFF}%i"pInfo[playerid][Points], pInfo[playerid][Respect], pInfo[playerid][Kills],pInfo[playerid][Deaths]);
         
SendClientMessage(clickedplayerid, -1iString);
         
format(iString,sizeof(iString),"{FCAE9D}Current Kills: {FFFFFF}%i {FCAE9D}| Current Deaths: {FFFFFF}%i {FCAE9D}| Ratio: {FFFFFF}%.2f"PlayerKills[playerid], PlayerDeaths[playerid], floatdiv(PlayerKills[playerid], PlayerDeaths[playerid]));
         
SendClientMessage(clickedplayerid, -1iString);
         
format(iString,sizeof(iString),"{FCAE9D}Headshots: {FFFFFF}%i"pInfo[playerid][Headshots]);
         
SendClientMessage(clickedplayerid, -1iString);
          return 
1;

and the call back

PHP код:
public OnPlayerClickPlayer(playeridclickedplayeridsourceshowstats(playeridclickedplayerid); 
edit: Oh, shit, i realized i just got confused with clickedplayerid and playerid i think it's the clientmessage should be on "playerid" while the stored datas on clicked playerid
Reply
#4

you're meant to show playerid the clickplayerid stats not show clickedplayerid clickplayerid's stats

so stock showstats(playerid, clickedplayerid) which now has two parameters. player id = where the message will be sent, clickedplayerid = clickplayerids stats
Reply
#5

Quote:
Originally Posted by rfr
Посмотреть сообщение
you're meant to show playerid the clickplayerid stats not show clickedplayerid clickplayerid's stats
Exactly, just my bad.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)