SA-MP Forums Archive
[AJUDA] Comando - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [AJUDA] Comando (/showthread.php?tid=344818)



[AJUDA] Comando - .FuneraL. - 22.05.2012

pawn Код:
CMD:tapa(playerid, params[])
{
    new giveplayerid, SetAdmStr[256], sendername[MAX_PLAYER_NAME], giveplayername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, sendername, MAX_PLAYER_NAME);
    GetPlayerName(giveplayerid, giveplayername, MAX_PLAYER_NAME);
    if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COR_VermelhoClaro, "Vocк Nгo tem Nнvel Suficiente Para Utilizar o Comando!");
    if(sscanf(params, "d", giveplayerid)) return SendClientMessage(playerid, COR_VermelhoClaro, "Uso Correto: /tapa [ID]");
    if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COR_VermelhoClaro, "[ERRO]: ID Nгo Conectado!");
    format(SetAdmStr, sizeof(SetAdmStr), "{00FFFF}[ADMIN]: %s Deu Um Tapa no Jogador %s", sendername, giveplayername);
    SendClientMessageToAll(-1, SetAdmStr);
    GetPlayerPos(giveplayerid, X,Y,Z);
    SetPlayerPos(giveplayerid, X,Y,Z+15);
    return 1;
}
Alguem sabe porque nгo aparece o "Nome" do player em que foi utilizado o comando? mas sim aparece meu nome duas vezes?


Re: [AJUDA] Comando - steeldark - 22.05.2012

tenta:

pawn Код:
CMD:tapa(playerid, params[])
{
    new giveplayerid, SetAdmStr[256], sendername[MAX_PLAYER_NAME], giveplayername[MAX_PLAYER_NAME];
    if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COR_VermelhoClaro, "Vocк Nгo tem Nнvel Suficiente Para Utilizar o Comando!");
    if(sscanf(params, "d", giveplayerid)) return SendClientMessage(playerid, COR_VermelhoClaro, "Uso Correto: /tapa [ID]");
    GetPlayerName(playerid, sendername, MAX_PLAYER_NAME);
    GetPlayerName(giveplayerid, giveplayername, MAX_PLAYER_NAME);
    if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COR_VermelhoClaro, "[ERRO]: ID Nгo Conectado!");
    format(SetAdmStr, sizeof(SetAdmStr), "{00FFFF}[ADMIN]: %s Deu Um Tapa no Jogador %s", sendername, giveplayername);
    SendClientMessageToAll(-1, SetAdmStr);
    GetPlayerPos(giveplayerid, X,Y,Z);
    SetPlayerPos(giveplayerid, X,Y,Z+15);
    return 1;
}



Re: [AJUDA] Comando - .ThePro - 22.05.2012

Код:
CMD:tapa(playerid, params[])
{
    new giveplayerid, SetAdmStr[256], Jogador[MAX_PLAYER_NAME], Outro[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Jogador, 23);
    GetPlayerName(giveplayerid, Outro, 23);
    if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COR_VermelhoClaro, "Vocк Nгo tem Nнvel Suficiente Para Utilizar o Comando!");
    if(sscanf(params, "d", giveplayerid)) return SendClientMessage(playerid, COR_VermelhoClaro, "Uso Correto: /tapa [ID]");
    if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COR_VermelhoClaro, "[ERRO]: ID Nгo Conectado!");
    format(SetAdmStr, sizeof(SetAdmStr), "{00FFFF}[ADMIN]: %s Deu Um Tapa no Jogador %s", Jogador, Outro);
    SendClientMessageToAll(-1, SetAdmStr);
    GetPlayerPos(giveplayerid, X,Y,Z);
    SetPlayerPos(giveplayerid, X,Y,Z+15);
    return 1;
}



Re: [AJUDA] Comando - .FuneraL. - 22.05.2012

Funcionou Corretamente steel, vocк mudou os GetPlayerName para baixo do sscanf nй?


Re: [AJUDA] Comando - steeldark - 22.05.2012

Quote:
Originally Posted by .FuneraL.
Посмотреть сообщение
Funcionou Corretamente steel, vocк mudou os GetPlayerName para baixo do sscanf nй?
Sim, troquei ali no if(!IsPlayerConnected(playerid)) tbm.. olha lб..

no caso, os codigos referentes aos parametros devem vim depois do sscanf.. si nгo nгo pega..



Re: [AJUDA] Comando - .FuneraL. - 22.05.2012

Ah Vlw pela Informaзгo , Nгo estava sabendo disso (:

@Off - Mandei convite lб no msn Steel (: kk



Re: [AJUDA] Comando - .FuneraL. - 22.05.2012

Aproveitando o Tуpico Aqui , Para nгo Criar Outro, Serб que alguem sabe o Problema deste CMD?

pawn Код:
CMD:daradmin(playerid, params[])
{
    new giveplayerid, SetAdmStr[256], NivelAdmin, sendername[MAX_PLAYER_NAME],giveplayername[MAX_PLAYER_NAME];
    if(!IsPlayerAdmin(playerid) && PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COR_VermelhoClaro, "Vocк Nгo tem Nнvel Suficiente Para Utilizar o Comando!");
    if(sscanf(params, "ud", giveplayerid, NivelAdmin)) return SendClientMessage(playerid, COR_VermelhoClaro, "Uso Correto: /daradmin [ID] [Nнvel]")
    GetPlayerName(playerid, sendername, MAX_PLAYER_NAME);
    GetPlayerName(giveplayerid, giveplayername, MAX_PLAYER_NAME);
    if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COR_VermelhoClaro, "[ERRO]: ID Invбlido!");
    if(NivelAdmin < 0 || NivelAdmin > 10) return SendClientMessage(playerid, COR_VermelhoClaro, "Nнvel Invбlido , Apenas de 1 a 10!");
    format(SetAdmStr, sizeof(SetAdmStr), "{00FFFF}[ADMIN]: Vocк Fez de %s Um Administrador Nнvel %d!",giveplayername,NivelAdmin);
    SendClientMessage(playerid, -1, SetAdmStr);
    format(SetAdmStr, sizeof(SetAdmStr), "{00FFFF}[ADMIN]: Vocк Foi Feito um Administrador Nнvel %d Pelo %s!", NivelAdmin, sendername);
    SendClientMessage(giveplayerid, -1, SetAdmStr);
    PlayerInfo[giveplayerid][pAdmin] = NivelAdmin;
    SalvarDados(giveplayerid);
    return 1;
}
Nгo estou conseguindo dar Admin pra Outra pessoa

@Off - Desculpem o Double Post ^^