[HELP] GetPlayerName Problem - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] GetPlayerName Problem (
/showthread.php?tid=198095)
[HELP] GetPlayerName Problem - Larsey123IsMe - 11.12.2010
I want the
pawn Код:
format(string, sizeof(string), "%s(%d) did set %s(%d)'s armour to %d",name, playerid, name, playerid, inputtext); //i want it like: [Lvrcr]Larsey123(0) did set RandomName(1)'s armour to 10
SendClientMessageToAll(0xFFFF00AA, string);
only show for admins
pawn Код:
case 2:
{
if(strlen(inputtext) > 3)
return SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: Your message was too long. Max: 3 characters");
new name[MAX_PLAYER_NAME], string[44];
GetPlayerName(adminPlayer[playerid], name, sizeof(name));
format(string, sizeof(string), "%s(%d) did set %s(%d)'s armour to %d",name, playerid, name, playerid, inputtext); //i want it like: [Lvrcr]Larsey123(0) did set RandomName(1)'s armour to 10
SendClientMessageToAll(0xFFFF00AA, string);
SetPlayerHealth(adminPlayer[playerid], floatstr(inputtext));
adminPlayer[playerid] = 0;
}
Re: [HELP] GetPlayerName Problem -
Pooh7 - 11.12.2010
Add on end of your script:
pawn Код:
forward AdminMessage(color, const string[]);
public AdminMessage(color, const string[])
{
for(new adm; adm < sizeof(MAX_PLAYERS); adm++)
{
if(IsPlayerConnected(adm))
{
if(PlayerInfo[adm][pAdmin] > 0 || IsPlayerAdmin(playerid)) // Change PlayerInfo[..][..] to your variable for admin levels.
{
SendClientMessage(playerid, color, string);
printf("%s", string);
}
}
}
return 1;
}
pawn Код:
case 2:
{
if(strlen(inputtext) > 3)
return SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: Your message was too long. Max: 3 characters");
new name[MAX_PLAYER_NAME], string[44];
GetPlayerName(adminPlayer[playerid], name, sizeof(name));
format(string, sizeof(string), "%s(%d) did set %s(%d)'s armour to %d",name, playerid, name, playerid, inputtext); //i want it like: [Lvrcr]Larsey123(0) did set RandomName(1)'s armour to 10
AdminMessage(0xFFFF00AA, string);
SetPlayerHealth(adminPlayer[playerid], floatstr(inputtext));
adminPlayer[playerid] = 0;
}
Re: [HELP] GetPlayerName Problem -
Cjgogo - 17.05.2011
REMOVED(POSTED TO WRONG TOPIC)