Help +rep
#1

Hello i finding long time for some script :-/ , But i can't found anyone can help me?

I need when player say some players ID to be name. Example

Hello id4 = Hello PlayerName
Hello id29 = Hello Vin
Like that...

If you help me thank alot +1 rep
Reply
#2

Check if the player entered "id"
And then check if what's next to id is a number.
pawn Код:
if (0 < [..] < MAX_PLAYERS))
And then replace them with the player's name.

(I've seen this feature on some server)
Reply
#3

I'll make this much simpler for you in the future... Although you could have looked on Wiki.

pawn Код:
stock GetName(playerid)
{
    new Name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
    return Name;
}
This means you can now directly format a name into a string using GetName(playerid);

Example:

pawn Код:
new string[6 + MAX_PLAYER_NAME];
format(string, sizeof(string), "Hello %s", GetName(playerid));
SendClientMessageToAll(-1, string);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)