Jump to content
  • 0

pomoc Dialog Kick


LuK3Z

Dotaz

16 odpovědí na tuto otázku

Recommended Posts

  • 0

Hmm tak skus toto

 

#define QCMD:%1()		 \
				 forward cmd_%1(playerid,params[],bool:help); \
				 public cmd_%1(playerid,params[],bool:help)
QCMD:kick(){
new id,dovod[50];
if(sscanf(params,"iz",id,dovod)) return SendClientMessage(playerid,-1,"Použi: /kick [iD] [dôvod]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"Hráč nieje na servery !");
if(isPlayerAdmin[id]) return SCM(playerid,-1,"Nemôžeš kicknuť admina !");
printf("Administrátor %s kickol hráča %s [ Dôvod: %s ]",Jmeno(playerid),Jmeno(id),dovod);
Kick(id);
return true;
}

 

Ak som pomohol daj +REP pls ;)

Link to comment
Share on other sites

  • 0

tak potom takto

 

#define DIALOG_KICK 1

 

 

public OnPlayerCommandText(playerid, cmdtext[])

{

if (strcmp("/kick", cmdtext, true, 4) == 0)

{

ShowPlayerDialog(playerid, DIALOG_KICK, DIALOG_STYLE_INPUT, "{FF0000}Kicknúť Hráča", "Vyber ID hráča", "Kick", "Zavriet");

return 1;

}

return 0;

}

 

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])

{

if(dialogid == DIALOG_KICK)

{

if(!response) return 0;

if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, -1, "Zle ID hraca");

new aN[128], str[128], pN[128];

GetPlayerName(playerid, aN, sizeof(aN)), GetPlayerName(strval(inputtext), pN, sizeof(pN));

format(str, sizeof(str), "%s Bol vyhodený adminom %s", pN, aN);

SendClientMessageToAll(-1, str);

Kick(strval(inputtext));

return 1;

}

}

Link to comment
Share on other sites

  • 0

Jo jo sem si totot spletl s jedním jiným :d Ale už to mám


Do příkazu :

ShowPlayerDialog(playerid,DIALOG_BARVY,DIALOG_STYLE_INPUT,"Kick","Kick","vybrat","Nic");

 

Potom do OnDialotResponse

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_BARVY)
{
 if(response == 1)
 {
new idx = strval(inputtext);
Kick(idx);
 }
}
return 1;
}

 

Netestoval jsem to takže nevím ale mělo by to býti tak že se mu otevře dialog a on napíše ID a ono to vyrazí to ID co napsal

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...