[Ajuda] Usando o nome do player ao invйs do ID.
#3

pawn Код:
CMD:ir(playerid, params[]) {

    if (!IsPlayerAdmin(playerid)) return 0x1;

    if (params[0] == ' ' || !strlen(params)) return 0x1;

    static
        perc,
        b,
        Float:c[3],
        nome[25];
       
    perc = b = -1;

    while (++perc < MAX_PLAYERS) {
        if (IsPlayerConnected(perc)) {
            GetPlayerName(perc, nome, 25);
            if (!strcmp(params, nome)) {
                b = perc;
                break;
            }
        }
    }
   
    if (IsPlayerConnected(b) && b != INVALID_PLAYER_ID) {
        GetPlayerPos(b, c[0], c[1], c[2]);
        SetPlayerPos(playerid, c[0], c[1], c[2]);

        SendClientMessage(playerid, -1, "Debug");
    }
    return 1;
}
Exemplo: /ir Alexandre.
Reply


Messages In This Thread
Usando o nome do player ao invйs do ID. - by Lessk - 20.02.2013, 12:54
Re: Usando o nome do player ao invйs do ID. - by MatheusAlcapone - 20.02.2013, 12:57
Re: Usando o nome do player ao invйs do ID. - by Abravanel - 20.02.2013, 14:08

Forum Jump:


Users browsing this thread: 1 Guest(s)