10.05.2013, 10:30
Could anyone help me ? how to make if i type /aduty and it will hide my Last Name (RP Server)
stock firstNameOnly(playerid)
{
new Name[MAX_PLAYER_NAME], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
for (new i = 0; i < (strlen(pName)); i++)
{
if (pName[i] != '_') Name[i] = pName[i];
else break;
}
return Name;
}
new str[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(str, 128, "Full name: %s || First name only: %s", pName, firstNameOnly(playerid));
SendClientMessage(playerid, 0xFFFFFFAA, str);
pawn Код:
pawn Код:
p.s. Kevin_Warde would be Kevin KevinWard_e would be KevinWard K_evinWarde would be K _KevinWarde would be KevinWarde_ would be KevinWarde I think that is what you wanted? |
public OnPlayerText(playerid, text[])
{
new str[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
if(PlayerInfo[playerid][pAdmDuty]) //If the player is on admin duty. Change this to your own string!
format(str, 128, "%s(%d): %s", firstNameOnly(playerid), playerid, text);
else format(str, 128, "%s(%d): %s", pName, playerid, text);
SendClientMessageToAll(0xFFFFFFAA, str);
return 1;
}