[Ajuda] Comando /tapa para Admins.
#1

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;
}

Reply
#2

Код:
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;
}
Reply
#3

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.
Reply
#4

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;
}
Reply
#5

Esqueci do ! --
Reply
#6

Agora funcionou, obrigado aos dois.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)