Some Commands doesnt show player's name - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Some Commands doesnt show player's name (
/showthread.php?tid=616654)
Some Commands doesnt show player's name -
ThatFag - 08.09.2016
Solved
Re: Some Commands doesnt show player's name -
F1N4L - 08.09.2016
Really?
Код:
PlayerName(playerid)
Change to
Re: Some Commands doesnt show player's name -
ThatFag - 08.09.2016
Solved
Re: Some Commands doesnt show player's name -
F1N4L - 08.09.2016
Show PlayerName(playerid) function...
Re: Some Commands doesnt show player's name -
ThatFag - 08.09.2016
Solved
Re: Some Commands doesnt show player's name -
thefirestate - 08.09.2016
Why don't you use foreach or GetPlayerPoolSize? Also, can we see SendClientMSG and AdminLevelName?
Re: Some Commands doesnt show player's name -
ThatFag - 08.09.2016
Solved
Re: Some Commands doesnt show player's name -
thefirestate - 08.09.2016
Can you try this command:
http://pastebin.com/1Ax94UNg
And tell me the results.
Edit: Also, considering the way your functions are done, you might want to read this:
https://sampforum.blast.hk/showthread.php?tid=570635 just in case.
Re: Some Commands doesnt show player's name -
ThatFag - 08.09.2016
The Problem coming from SendClientMSG - cuz if i use sendclinetmessage it works okay
someone can fix that pls ?
Re: Some Commands doesnt show player's name -
Threshold - 08.09.2016
I dunno about ya'll, but I'd do it like this:
PHP код:
COMMAND:admins(playerid)
{
new Staff[MAX_PLAYERS][2], admincount = 0, helpercount = 0;
for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
{
if(!IsPlayerConnected(i) || !PlayerTemp[i][loggedIn] || PlayerInfo[i][power] == 31337) continue;
if(PlayerInfo[i][power] > 0) Staff[admincount++][0] = i;
else if(PlayerInfo[i][helper] > 0) Staff[helpercount++][1] = i;
}
SendClientMessage(playerid, 0x3776CCFF, "[Server Staff] {ABCBF5}Administrators:");
for(new i = 0, fstr[80]; i < admincount; i++)
{
format(fstr, sizeof(fstr), "%s %s (ID: %d) %s %s",
AdminLevelName(Staff[i][0]), PlayerName(Staff[i][0]), Staff[i][0], (PlayerTemp[Staff[i][0]][adminduty] == 1) ? ("{1A661A}ON-DUTY") : (""), (IsPlayerAFK(Staff[i][0])) ? ("AFK") : (""));
SendClientMessage(playerid, 0xE1E3E6FF, fstr);
}
SendClientMessage(playerid, 0x3776CCFF, "[Server Staff] {ABCBF5}Helpers:");
for(new i = 0, fstr[60]; i < helpercount; i++)
{
format(fstr, sizeof(fstr), " %s (ID: %d) %s %s",
RPName(Staff[i][1]), Staff[i][1], (PlayerTemp[Staff[i][1]][helperduty] == 1) ? ("{1A661A}ON-DUTY") : (""), (IsPlayerAFK(Staff[i][1])) ? ("AFK") : (""));
SendClientMessage(playerid, 0xE1E3E6FF, fstr);
}
return 1;
}