OnPlayerClick Bug?
#1

Hello Guys I Want This Show When I Clicked Player But It Not Working Pls Help Me
PHP код:
public ShowStatistics(playeridplayerid2)
{
    if(
playerid2 == INVALID_PLAYER_ID) return 1;
    new 
string[1000], string2[556], hms;
    
TotalGameTime(playerid2hms);
    
format(string2556"{%06x}%s[%d] Stats!\n\n", (GetPlayerColor(playerid2) >>> 8), IsPlayerName(playerid2), playerid2);
    
strcat(stringstring2);
    
strcat(string""COL_RED"");
    
format(string2556""COL_RED"Admin: "COL_YELLOW"%d\n"PInfo[playerid2][Admin]); strcat(stringstring2);
    
format(string2556""COL_RED"Online Time: "COL_YELLOW"%d:%d:%d\n"h,m,s); strcat(stringstring2);
    
format(string2556""COL_RED"VIP: "COL_YELLOW"%d\n"PInfo[playerid2][VIP]); strcat(stringstring2);
    
format(string2556""COL_RED"Score: "COL_YELLOW"%d\n"GetPlayerScore(playerid2)); strcat(stringstring2);
    
format(string2556""COL_RED"Cash: "COL_YELLOW"$%d\n"PInfo[playerid2][Money]); strcat(stringstring2);
    
format(string2556""COL_RED"Kills: "COL_YELLOW"%d\n"PInfo[playerid2][Kill]); strcat(stringstring2);
    
format(string2556""COL_RED"Deaths: "COL_YELLOW"%d\n"PInfo[playerid2][Death]); strcat(stringstring2);
    new 
Float:ratio = (float(PInfo[playerid2][Kill])/float(PInfo[playerid2][Death]));
    
format(string2556""COL_RED"[K/D]: "COL_YELLOW"%.3f\n"ratio); strcat(stringstring2);
    
format(string2556"%s[%d] Stats!"GetPlayerColor(playerid2) >>> 8IsPlayerName(playerid2),playerid2);
    return 
1;
}
public 
OnPlayerClickPlayer(playeridclickedplayeridsource)
{
    
ShowStatistics(playeridclickedplayerid);
     return 
1;

When I Clicked Player Nothing Happen I Put This On My Admin FS How To Fix It?
Reply
#2

try to replace this code:
PHP код:
public ShowStatistics(playeridplayerid2

    if(
playerid2 == INVALID_PLAYER_ID) return 1
    new 
string[1000], string2[556], hms
    
TotalGameTime(playerid2hms); 
    
format(string2556"{%06x}%s[%d] Stats!\n\n", (GetPlayerColor(playerid2) >>> 8), IsPlayerName(playerid2), playerid2); 
    
strcat(stringstring2); 
    
strcat(string""COL_RED""); 
    
format(string2556""COL_RED"Admin: "COL_YELLOW"%d\n"PInfo[playerid2][Admin]); strcat(stringstring2); 
    
format(string2556""COL_RED"Online Time: "COL_YELLOW"%d:%d:%d\n"h,m,s); strcat(stringstring2); 
    
format(string2556""COL_RED"VIP: "COL_YELLOW"%d\n"PInfo[playerid2][VIP]); strcat(stringstring2); 
    
format(string2556""COL_RED"Score: "COL_YELLOW"%d\n"GetPlayerScore(playerid2)); strcat(stringstring2); 
    
format(string2556""COL_RED"Cash: "COL_YELLOW"$%d\n"PInfo[playerid2][Money]); strcat(stringstring2); 
    
format(string2556""COL_RED"Kills: "COL_YELLOW"%d\n"PInfo[playerid2][Kill]); strcat(stringstring2); 
    
format(string2556""COL_RED"Deaths: "COL_YELLOW"%d\n"PInfo[playerid2][Death]); strcat(stringstring2); 
    new 
Float:ratio = (float(PInfo[playerid2][Kill])/float(PInfo[playerid2][Death])); 
    
format(string2556""COL_RED"[K/D]: "COL_YELLOW"%.3f\n"ratio); strcat(stringstring2); 
    
format(string2556"%s[%d] Stats!"GetPlayerColor(playerid2) >>> 8IsPlayerName(playerid2),playerid2); 
    return 
1

with this:
PHP код:
public ShowStatistics(playeridplayerid2)
{
    if(
playerid2 == INVALID_PLAYER_ID) return 1;
    new 
string[1000], string2[556], hms;
    
TotalGameTime(playerid2hms);
    
format(string2sizeof(string2), "{%06x}%s[%d] Stats!\n\n", (GetPlayerColor(playerid2) >>> 8), IsPlayerName(playerid2), playerid2);
    
SendClientMessage(playerid0xFFFFFFAAstring2);
    
format(string2556""COL_RED"Admin: "COL_YELLOW"%d\n"PInfo[playerid2][Admin]);
    
SendClientMessage(playerid0xFFFFFFAAstring2);
    
format(string2556""COL_RED"Online Time: "COL_YELLOW"%d:%d:%d\n"h,m,s);
    
SendClientMessage(playerid0xFFFFFFAAstring2);
    
format(string2556""COL_RED"VIP: "COL_YELLOW"%d\n"PInfo[playerid2][VIP]);
    
SendClientMessage(playerid0xFFFFFFAAstring2);
    
format(string2556""COL_RED"Score: "COL_YELLOW"%d\n"GetPlayerScore(playerid2));
    
SendClientMessage(playerid0xFFFFFFAAstring2);
    
format(string2556""COL_RED"Cash: "COL_YELLOW"$%d\n"PInfo[playerid2][Money]);
    
SendClientMessage(playerid0xFFFFFFAAstring2);
    
format(string2556""COL_RED"Kills: "COL_YELLOW"%d\n"PInfo[playerid2][Kill]);
    
SendClientMessage(playerid0xFFFFFFAAstring2);
    
format(string2556""COL_RED"Deaths: "COL_YELLOW"%d\n"PInfo[playerid2][Death]);
    
SendClientMessage(playerid0xFFFFFFAAstring2);
    new 
Float:ratio = (float(PInfo[playerid2][Kill])/float(PInfo[playerid2][Death]));
    
format(string2556""COL_RED"[K/D]: "COL_YELLOW"%.3f\n"ratio);
    
SendClientMessage(playerid0xFFFFFFAAstring2);
    
format(string2556"%s[%d] Stats!"GetPlayerColor(playerid2) >>> 8IsPlayerName(playerid2),playerid2);
    
SendClientMessage(playerid0xFFFFFFAAstring2);
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)