SA-MP Forums Archive
[Ajuda] Comando /tapa para Admins. - 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 /tapa para Admins. (/showthread.php?tid=363587)



[Ajuda] Comando /tapa para Admins. - Gabriel Santana - 28.07.2012

Vejam, tenho um comando de /tapa que funciona aqui normalmente, mais quero apenas colocar eles para players logados na rcon, preciso da ajuda de vocкs que coloquem apenas para admins.

Por favor, nada de zcmd. apenas strcmp.


Quote:

if(strcmp(cmd, "/tapa", true) == 0)
{
new tmp[256];
tmp = strtok(cmdtext, idx);

if(strlen(tmp) == 0) return SendClientMessage(playerid, VERDE, "[SERVER] : /tapa [playerid]");
new nome[30],Gabi[200],giveplayer[MAX_PLAYERS],giveplayerid;
GetPlayerName(playerid,nome,sizeof(nome));
GetPlayerName(giveplayerid,giveplayer,sizeof(givep layer));
format(Gabi,sizeof(Gabi),"[SERVER] : %s de uma tapa no player %s !",nome,giveplayer);
SendClientMessageToAll(ROXOCLARO,Gabi);
new Float,Float:y,Float:w;
GetPlayerPos(giveplayerid,x,y,w);
SetPlayerPos(giveplayerid,x,y,w+10);


return 1;
}




Re: [Ajuda] Comando /tapa para Admins. - MatriXBorn - 28.07.2012

Код:
if(strcmp(cmd, "/tapa", true) == 0)
{
if(!IsPlayerAdmin(playerid))
  return SendClientMessage(playerid,-1,"[ERRO] Somente Rcon pode usar");
new tmp[256];
tmp = strtok(cmdtext, idx);

if(strlen(tmp) == 0) return SendClientMessage(playerid, VERDE, "[SERVER] : /tapa [playerid]");
new nome[30],Gabi[200],giveplayer[MAX_PLAYERS],giveplayerid;
GetPlayerName(playerid,nome,sizeof(nome));
GetPlayerName(giveplayerid,giveplayer,sizeof(givep layer));
format(Gabi,sizeof(Gabi),"[SERVER] : %s de uma tapa no player %s !",nome,giveplayer);
SendClientMessageToAll(ROXOCLARO,Gabi);
new Float:x,Float:y,Float:w;
GetPlayerPos(giveplayerid,x,y,w);
SetPlayerPos(giveplayerid,x,y,w+10);


return 1;
}



Re: [Ajuda] Comando /tapa para Admins. - Gabriel Santana - 28.07.2012

MatriXBorn,

Jб tentei colocando assim tambйm mais nгo conseguir.

Copilei tudo certo, ai quando entra no jogo e coloco /coletet sу aparece a mensagem, mais o comando que й bom nao acontece.



Re: [Ajuda] Comando /tapa para Admins. - ipsBruno - 28.07.2012

pawn Код:
if(strcmp(cmd, "/tapa", true) == 0)
{
if(!IsPlayerAdmin(playerid))
  return SendClientMessage(playerid,-1,"[ERRO] Somente Rcon pode usar");
new tmp[256];
tmp = strtok(cmdtext, idx);

if(strlen(tmp) == 0) return SendClientMessage(playerid, VERDE, "[SERVER] : /tapa [playerid]");
new nome[30],Gabi[200],giveplayer[MAX_PLAYERS],giveplayerid;
GetPlayerName(playerid,nome,sizeof(nome));
GetPlayerName(giveplayerid,giveplayer,sizeof(givep layer));
format(Gabi,sizeof(Gabi),"[SERVER] : %s de uma tapa no player %s !",nome,giveplayer);
SendClientMessageToAll(ROXOCLARO,Gabi);
new Float:x,Float:y,Float:w;
GetPlayerPos(giveplayerid,x,y,w);
SetPlayerPos(giveplayerid,x,y,w+10);


return 1;
}



Re: [Ajuda] Comando /tapa para Admins. - MatriXBorn - 28.07.2012

Esqueci do ! --


Re: [Ajuda] Comando /tapa para Admins. - Gabriel Santana - 28.07.2012

Agora funcionou, obrigado aos dois.