Jump to content
  • 0

pomoc Ban ID duvod


Amenadiel

Dotaz

Vše jde v pohode až na ten důvod:D

 

CMD:ban(playerid, params[])
{
new id, reason[170];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREEN,"Nejste Rcon admin!");
else if(sscanf(params, "us", id, reason))SendClientMessage(playerid, COLOR_WHITE, "Použij: /ban [iD][Duvod]");
else if(id==playerid)SendClientMessage(playerid,COLOR_WHITE,"Nemůžeš Zabanovat sám sebe!!");
else if (id==INVALID_PLAYER_ID)SendClientMessage(playerid,COLOR_WHITE,"Hráč není připojen!!");
else {
new Name[MAX_PLAYER_NAME], KickMessage[128];
new Name2[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
GetPlayerName(id, Name2, sizeof(Name2));
format(KickMessage, sizeof(KickMessage), "Admin %s(%d) Zabanoval hráče %s(%d)", Name, playerid, Name2, id);
SendClientMessageToAll(COLOR_WHITE, KickMessage);
Ban(id);
}
return 1;
}

Link to comment
Share on other sites

8 odpovědí na tuto otázku

Recommended Posts

  • 0

CMD:ban(playerid, params[])

{

new id, reason[170];

if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREEN,"Nejste Rcon admin!");

else if(sscanf(params, "us", id, reason))SendClientMessage(playerid, COLOR_WHITE, "Použij: /ban [iD][Duvod]");

else if(id==playerid)SendClientMessage(playerid,COLOR_WHITE,"Nemůžeš Zabanovat sám sebe!!");

else if (id==INVALID_PLAYER_ID)SendClientMessage(playerid,COLOR_WHITE,"Hráč není připojen!!");

else {

new Name[MAX_PLAYER_NAME], KickMessage[128];

new Name2[MAX_PLAYER_NAME];

GetPlayerName(playerid, Name, sizeof(Name));

GetPlayerName(id, Name2, sizeof(Name2));

format(KickMessage, sizeof(KickMessage), "Admin %s(%d) Zabanoval hráče %s(%d) [Dôvod]: %s", Name, playerid, Name2, id,params);

SendClientMessageToAll(COLOR_WHITE, KickMessage);

Ban(id);

}

return 1;

}

Link to comment
Share on other sites

  • 0

CMD:ban(playerid, params[])
{
new id, reason[170];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREEN,"Nejste Rcon admin!");
else if(sscanf(params, "us", id, reason))SendClientMessage(playerid, COLOR_WHITE, "Použij: /ban [iD][Duvod]");
else if(id==playerid)SendClientMessage(playerid,COLOR_WHITE,"Nemůžeš Zabanovat sám sebe!!");
else if (id==INVALID_PLAYER_ID)SendClientMessage(playerid,COLOR_WHITE,"Hráč není připojen!!");
else {
new Name[MAX_PLAYER_NAME], KickMessage[128];
new Name2[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
GetPlayerName(id, Name2, sizeof(Name2));
format(KickMessage, sizeof(KickMessage), "Admin %s(%d) Zabanoval hráče %s(%d) [ Dôvod: %s ]", Name, playerid, Name2, id, reason);
SendClientMessageToAll(COLOR_WHITE, KickMessage);
BanEx(id, reason);
}
return 1;
}

 

ešte si medzi to môžeš pridať:

else if(!reason[0]) return SendClientMessage(playerid, COLOR_GREEN, "Nenapísal si dôvod");

 

aj keď sscanf obsahuje isnull takže to veľmi netreba

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...