Name Tag Question.
#5

pawn Код:
new PlayerOriginalName[MAX_PLAYERS][MAX_PLAYER_NAME];

public OnPlayerConnect(playerid)
{
    GetPlayerName(playerid, PlayerOriginalName[playerid], MAX_PLAYER_NAME);
    return 1;
}

CMD:dancing(playerid, params[])
{
    SetPlayerPos(playerid,12.3,45.6,78.9);
    AppendTagToName(playerid,"DANCING");
    return 1;
}

stock AppendTagToName(playerid,tag) // Append a tag to the players name
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(name, sizeof(name), "[%s]%s", tag, name);
    SetPlayerName(playerid, name);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    // Save your data using PlayerOriginalName[playerid] rather than GetPlayerName (you can just use format(name, sizeof(name), PlayerOriginalName[playerid]); to save changing each variable)
    return 1;
}
Reply


Messages In This Thread
Name Tag Question. - by Sting. - 28.08.2014, 07:36
Re: Name Tag Question. - by Rudy_ - 28.08.2014, 07:43
Re: Name Tag Question. - by JordanDoughty - 28.08.2014, 09:35
Re: Name Tag Question. - by MicroD - 28.08.2014, 10:13
Re: Name Tag Question. - by tyler12 - 28.08.2014, 10:50
Re: Name Tag Question. - by Sting. - 28.08.2014, 11:17

Forum Jump:


Users browsing this thread: 1 Guest(s)