Help with displaying ClientMessage
#1

Okay, first off, I know there has been a few posts about this, however, I've tried all the solutions I could find. I am trying to make the message appear before kicking or banning someone. I have already done the process of creating the timer and all this. So here is what my /kick cmd looks like...Anyone see anything wrong?

pawn Код:
if(strcmp(cmd, "/kick", true) == 0)
{
if(gAdminOnDuty[playerid] != 1)
{
SendClientMessage(playerid, COLOR_GRAD2, "You must be on duty to use this command!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_USAGE, "USAGE: /kick [playerid] [reason]");
return 1;
}
new playa;
if(IsStringAName(tmp))
{
playa = GetPlayerID(tmp);
}
else
{
playa = strval(tmp);
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[144];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_USAGE, "USAGE: /kick [playerid] [reason]");
return 1;
}
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if ((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >= 1 && PlayerInfo[playerid][pRealAdmin] == 1)
{
format(string, sizeof(string), "AdmCmd: %s Kicked you, Reason: %s",sendername,result);
SendClientMessage(playa, COLOR_ADMIN, string);
KickTimer[playa] = SetTimerEx("KickPlayer",5000,true,"d",playa);
Kick(playa);
format(string, sizeof(string), "AdmCmd: %s Kicked %s, Reason: %s",sendername,giveplayer,result);
printf("%s",string);
KickLog(string);
format(string, sizeof(string), "AdmCmd: %s Kicked %s, Reason: %s",sendername,giveplayer,result);
SendClientMessageToAll(COLOR_ADMIN, string);
}
else
{
SendClientMessage(playerid, COLOR_RED, "Invalid admin level, you cannot use this command");
}
return 1;
}
Reply


Messages In This Thread
Help with displaying ClientMessage - by Blade_Cervetti - 21.02.2015, 17:04
Re: Help with displaying ClientMessage - by Ritzy2K - 21.02.2015, 17:06
Re: Help with displaying ClientMessage - by Blade_Cervetti - 21.02.2015, 17:08
Re: Help with displaying ClientMessage - by CalvinC - 21.02.2015, 17:23
Re: Help with displaying ClientMessage - by Blade_Cervetti - 21.02.2015, 17:25
Re: Help with displaying ClientMessage - by CalvinC - 21.02.2015, 17:27
Re: Help with displaying ClientMessage - by Blade_Cervetti - 21.02.2015, 17:55

Forum Jump:


Users browsing this thread: 2 Guest(s)