help me with this command
#1

is this code good? the player i banned. Doesn't get the message.


Код:
CMD:trollban(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]:You are not rcon admin");
new targetid,  str[75];
if(sscanf(params,"u",targetid)) return SendClientMessage(playerid,COLOR_ERROR,"Usage(playerid)");
format(str,sizeof(str),"(ADMIN BAN): An admin has banned %d",targetid);
SendClientMessageToAll(COLOR_ADMIN,str);
return 1;
}
Reply
#2

Use SendClientMessage(targetid,COLOR_ADMIN,str);

Instead of

SendClientMessageToAll(COLOR_ADMIN,str);
Reply
#3

Quote:
Originally Posted by ahameed4755
Посмотреть сообщение
is this code good? the player i banned. Doesn't get the message.


Код:
CMD:trollban(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]:You are not rcon admin");
new targetid,  str[75];
if(sscanf(params,"u",targetid)) return SendClientMessage(playerid,COLOR_ERROR,"Usage(playerid)");
format(str,sizeof(str),"(ADMIN BAN): An admin has banned %d",targetid);
SendClientMessageToAll(COLOR_ADMIN,str);
return 1;
}
****** up "KickBan.inc samp" and pick the first site. This should fix your problem.
Reply
#4

I think it is better this way.

Код:
CMD:trollban(playerid,params[])
{
	if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]:You are not rcon admin");
	new targetid,str[75],adm[MAX_PLAYER_NAME],name[MAX_PLAYER_NAME],msg[64];
	if(sscanf(params,"u",targetid)) return SendClientMessage(playerid,COLOR_ERROR,"Usage(playerid)");
	GetPlayerName(targetid,name,sizeof(name));
	format(str,sizeof(str),"(ADMIN BAN): An admin has banned %s",name);
	SendClientMessageToAll(COLOR_ADMIN,str);
	GetPlayerName(playerid,adm,sizeof(adm));
	format(msg,sizeof(msg),"You have been banned by admin %s",adm);
	SendClientMessage(targetid,COLOR_ADMIN,msg);
	return 1;
}
Reply
#5

%d in string used to get numbers %s used to get strings ( words and numbers ) and you miss to get player name.
PHP код:
CMD:trollban(playerid,params[])
{
if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]:You are not rcon admin");
new 
targetid,  str[75], name2[MAX_PLAYER_NAME];
if(
sscanf(params,"u",targetid)) return SendClientMessage(playerid,COLOR_ERROR,"Usage(playerid)");
GetPlayerName(targetid,name2,sizeof(name2));
format(str,sizeof(str),"(ADMIN BAN): An admin has banned %s",targetid);
SendClientMessageToAll(COLOR_ADMIN,str);
return 
1;

Reply
#6

NoahF already gave out the solution to this problem.

ahameed4755 is saying that the banned player doesn't see the message.
Everything posted was useless for this situation.

A message after a kick or a ban doesn't show up on the banned player's screen.

You have to send the message, and then create a timer more than 100ms (As far as I know) and then kick/ban the player.
Reply
#7

Quote:
Originally Posted by Stinged
Посмотреть сообщение
NoahF already gave out the solution to this problem.

ahameed4755 is saying that the banned player doesn't see the message.
Everything posted was useless for this situation.

A message after a kick or a ban doesn't show up on the banned player's screen.

You have to send the message, and then create a timer more than 100ms (As far as I know) and then kick/ban the player.
Dude this ain't ban, its fake ban to let player scare " troll ban "
Reply
#8

Код:
CMD:trollban(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]:You are not rcon admin");
new targetid,  str[75], name2[MAX_PLAYER_NAME];
if(sscanf(params,"u",targetid)) return SendClientMessage(playerid,COLOR_ERROR,"Usage(playerid)");
GetPlayerName(targetid,name2,sizeof(name2));
format(str,sizeof(str),"(ADMIN BAN): An admin has banned %s",targetid);
SendClientMessageToAll(COLOR_ADMIN,str);
SendClientMessage(targetid, COLOR_ADMIN,"SERVER: You have been banned from the server");
SendClientMessage(targetid, COLOR_GREY,"Server closed connection.");
return 1;
}
Rep+ Me.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)