OnPlayerClick Bug? -
dh240473 - 15.01.2016
Hello Guys I Want This Show When I Clicked Player But It Not Working Pls Help Me
PHP код:
public ShowStatistics(playerid, playerid2)
{
if(playerid2 == INVALID_PLAYER_ID) return 1;
new string[1000], string2[556], h, m, s;
TotalGameTime(playerid2, h, m, s);
format(string2, 556, "{%06x}%s[%d] Stats!\n\n", (GetPlayerColor(playerid2) >>> 8), IsPlayerName(playerid2), playerid2);
strcat(string, string2);
strcat(string, ""COL_RED"");
format(string2, 556, ""COL_RED"Admin: "COL_YELLOW"%d\n", PInfo[playerid2][Admin]); strcat(string, string2);
format(string2, 556, ""COL_RED"Online Time: "COL_YELLOW"%d:%d:%d\n", h,m,s); strcat(string, string2);
format(string2, 556, ""COL_RED"VIP: "COL_YELLOW"%d\n", PInfo[playerid2][VIP]); strcat(string, string2);
format(string2, 556, ""COL_RED"Score: "COL_YELLOW"%d\n", GetPlayerScore(playerid2)); strcat(string, string2);
format(string2, 556, ""COL_RED"Cash: "COL_YELLOW"$%d\n", PInfo[playerid2][Money]); strcat(string, string2);
format(string2, 556, ""COL_RED"Kills: "COL_YELLOW"%d\n", PInfo[playerid2][Kill]); strcat(string, string2);
format(string2, 556, ""COL_RED"Deaths: "COL_YELLOW"%d\n", PInfo[playerid2][Death]); strcat(string, string2);
new Float:ratio = (float(PInfo[playerid2][Kill])/float(PInfo[playerid2][Death]));
format(string2, 556, ""COL_RED"[K/D]: "COL_YELLOW"%.3f\n", ratio); strcat(string, string2);
format(string2, 556, "%s[%d] Stats!", GetPlayerColor(playerid2) >>> 8, IsPlayerName(playerid2),playerid2);
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
ShowStatistics(playerid, clickedplayerid);
return 1;
}
When I Clicked Player Nothing Happen I Put This On My Admin FS How To Fix It?
Re: OnPlayerClick Bug? -
radiobizza - 15.01.2016
try to replace this code:
PHP код:
public ShowStatistics(playerid, playerid2)
{
if(playerid2 == INVALID_PLAYER_ID) return 1;
new string[1000], string2[556], h, m, s;
TotalGameTime(playerid2, h, m, s);
format(string2, 556, "{%06x}%s[%d] Stats!\n\n", (GetPlayerColor(playerid2) >>> 8), IsPlayerName(playerid2), playerid2);
strcat(string, string2);
strcat(string, ""COL_RED"");
format(string2, 556, ""COL_RED"Admin: "COL_YELLOW"%d\n", PInfo[playerid2][Admin]); strcat(string, string2);
format(string2, 556, ""COL_RED"Online Time: "COL_YELLOW"%d:%d:%d\n", h,m,s); strcat(string, string2);
format(string2, 556, ""COL_RED"VIP: "COL_YELLOW"%d\n", PInfo[playerid2][VIP]); strcat(string, string2);
format(string2, 556, ""COL_RED"Score: "COL_YELLOW"%d\n", GetPlayerScore(playerid2)); strcat(string, string2);
format(string2, 556, ""COL_RED"Cash: "COL_YELLOW"$%d\n", PInfo[playerid2][Money]); strcat(string, string2);
format(string2, 556, ""COL_RED"Kills: "COL_YELLOW"%d\n", PInfo[playerid2][Kill]); strcat(string, string2);
format(string2, 556, ""COL_RED"Deaths: "COL_YELLOW"%d\n", PInfo[playerid2][Death]); strcat(string, string2);
new Float:ratio = (float(PInfo[playerid2][Kill])/float(PInfo[playerid2][Death]));
format(string2, 556, ""COL_RED"[K/D]: "COL_YELLOW"%.3f\n", ratio); strcat(string, string2);
format(string2, 556, "%s[%d] Stats!", GetPlayerColor(playerid2) >>> 8, IsPlayerName(playerid2),playerid2);
return 1;
}
with this:
PHP код:
public ShowStatistics(playerid, playerid2)
{
if(playerid2 == INVALID_PLAYER_ID) return 1;
new string[1000], string2[556], h, m, s;
TotalGameTime(playerid2, h, m, s);
format(string2, sizeof(string2), "{%06x}%s[%d] Stats!\n\n", (GetPlayerColor(playerid2) >>> 8), IsPlayerName(playerid2), playerid2);
SendClientMessage(playerid, 0xFFFFFFAA, string2);
format(string2, 556, ""COL_RED"Admin: "COL_YELLOW"%d\n", PInfo[playerid2][Admin]);
SendClientMessage(playerid, 0xFFFFFFAA, string2);
format(string2, 556, ""COL_RED"Online Time: "COL_YELLOW"%d:%d:%d\n", h,m,s);
SendClientMessage(playerid, 0xFFFFFFAA, string2);
format(string2, 556, ""COL_RED"VIP: "COL_YELLOW"%d\n", PInfo[playerid2][VIP]);
SendClientMessage(playerid, 0xFFFFFFAA, string2);
format(string2, 556, ""COL_RED"Score: "COL_YELLOW"%d\n", GetPlayerScore(playerid2));
SendClientMessage(playerid, 0xFFFFFFAA, string2);
format(string2, 556, ""COL_RED"Cash: "COL_YELLOW"$%d\n", PInfo[playerid2][Money]);
SendClientMessage(playerid, 0xFFFFFFAA, string2);
format(string2, 556, ""COL_RED"Kills: "COL_YELLOW"%d\n", PInfo[playerid2][Kill]);
SendClientMessage(playerid, 0xFFFFFFAA, string2);
format(string2, 556, ""COL_RED"Deaths: "COL_YELLOW"%d\n", PInfo[playerid2][Death]);
SendClientMessage(playerid, 0xFFFFFFAA, string2);
new Float:ratio = (float(PInfo[playerid2][Kill])/float(PInfo[playerid2][Death]));
format(string2, 556, ""COL_RED"[K/D]: "COL_YELLOW"%.3f\n", ratio);
SendClientMessage(playerid, 0xFFFFFFAA, string2);
format(string2, 556, "%s[%d] Stats!", GetPlayerColor(playerid2) >>> 8, IsPlayerName(playerid2),playerid2);
SendClientMessage(playerid, 0xFFFFFFAA, string2);
return 1;
}