[admin kick problem] -
basse - 30.09.2012
pawn Код:
dcmd_kick(playerid,params[])
{
if(IsPlayerAdmin(playerid))
{
new ID;
new pname[24];
new string[200];
new reason;
if(sscanf(params, "uz", ID, reason)) return SendClientMessage(playerid, COLOR_RED, "Usage: /kick (ID) (REASON)");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_RED, "Invalid ID.");
GetPlayerName(playerid, pname,24);
GetPlayerName(ID);
format(string, 200, "[ADMIN KICK] %S", reason);
SendClientMessageToAll(COLOR_GREEN, string);
format(string, 200, "[ADMIN ACTION] Admin has kicked %s(%d) %s", pname, ID, reason);
Kick(ID);
return 1;
}
return SendClientMessage(playerid, COLOR_RED, "You Are Not An Admin");
}
Whats the problem it gets like this
http://gyazo.com/32cdd3b6b9c34f405675ea303e191157
Re: [admin commands problem] -
trapstar2020 - 30.09.2012
ban(playerid)//ban
ummmm u need to set a jail spot//jail
kick(playerid)//kick
toggleplayercontroller//freeze
you also need to look at sscanf2 for a second player
Re: [admin commands problem] -
basse - 30.09.2012
okay i might not have been clear enough i can make the commands work, its not the "reason" part that doesent work like /kick id reason so when i do
/kick 0 test it will be
admin kicked "someplayername" t(0)
Re: [admin commands problem] -
trapstar2020 - 30.09.2012
here iz a eg
pawn Код:
new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "AdmCmd: %s has been kicked by %s, reason: %s", pname(playerb), pnameplayerid), params);
SendClientMessageToAll(-1, string);
Re: [admin commands problem] -
trapstar2020 - 30.09.2012
pawn Код:
stock RPN(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
for(new i = 0; i < MAX_PLAYER_NAME; i++)
{
if(name[i] == '_') name[i] = ' ';
}
return name;
}
CMD:kick(playerid, params[])
{
new playerb, string[128];
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on admin duty.");
if(sscanf(params, "us[128]", playerb, params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /kick [playerid] [reason]");
if(PlayerInfo[playerid][pAdmin] < PlayerInfo[playerb][pAdmin]) return SendClientMessage(playerid, COLOR_GREY, "Player has a higher admin level than you."); format(string, sizeof(string), "AdmCmd: %s has been kicked by %s, reason: %s", RPN(playerb), RPN(playerid), params);
format(string, sizeof(string), "AdmCmd: %s has been kicked by %s, reason: %s", RPN(playerb), RPN(playerid), params);
SendClientMessageToAll(COLOR_LIGHTRED, string);
Kick(playerb);
return 1;
}
Try this on for size it should work you need sscanf2 and zcmd
Re: [admin commands problem] -
basse - 30.09.2012
Okay how many times am i going to explain my self 1. i don't want it to type kicked "BY" admin i just want it to say
player %s was kicked "BY an admin not wich admin"
and 2. i said dcmd >.<
Re: [admin commands problem] -
trapstar2020 - 30.09.2012
well change it
it used the same with i think dcmd= dcmd_kick and cmd:kick iz zcmd
well just move rpn(playerid)
rpn(playerid) ==== kicker rpn(playerb) person getting kick
Re: [admin commands problem] -
basse - 30.09.2012
updated the command