19.09.2009, 13:35
i made a simple kick and ban command which it kicks and ban.... is there a way to use " Kick(playerid) " and "Ban(playerid)" without the user being logged in rcon?
because i'm making some admin commands.... and when the " admins " tried the command /kick it say:
" /kick: You are not an admin! "
" /ban: You are not an admin! "
here's the commands:
i don't wish to give the rcon password to admins... ( i wish to keep it for myself that's why i make the commands )
Please note, that if the person that use this command log in rcon it works fine.
but since there is no " LogPlayerInRcon(playerid); " i cannot log ppl in rcon without telling them the password...
because i'm making some admin commands.... and when the " admins " tried the command /kick it say:
" /kick: You are not an admin! "
" /ban: You are not an admin! "
here's the commands:
Код:
if(strcmp(cmd,"/kick", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_WHITE,"USAGE: /kick [playerid]");
return 1;
}
giveplayerid = strval(tmp);
if(PlayerInfo[giveplayerid][admin] == 1)
{
SendClientMessage(playerid,COLOR_BRIGHTRED,"SAC: You cannot kick an admin!");
return 1;
}
if(PlayerInfo[playerid][admin] == 1)
{
format(string, sizeof(string),"SAC: Admin %s kicked %s.",PlayerInfo[playerid][name],PlayerInfo[giveplayerid][name]);
SendClientMessageToAll(COLOR_BRIGHTRED,string);
Kick(giveplayerid);
return 1;
}
return 1;
}
if(strcmp(cmd,"/ban", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_WHITE,"USAGE: /ban [playerid]");
return 1;
}
giveplayerid = strval(tmp);
if(PlayerInfo[giveplayerid][admin] == 1)
{
SendClientMessage(playerid,COLOR_BRIGHTRED,"SAC: You cannot ban an admin!");
return 1;
}
if(PlayerInfo[playerid][admin] == 1)
{
format(string, sizeof(string),"SAC: Admin %s banned %s.",PlayerInfo[playerid][name],PlayerInfo[giveplayerid][name]);
SendClientMessageToAll(COLOR_BRIGHTRED,string);
Ban(giveplayerid);
return 1;
}
return 1;
}
Please note, that if the person that use this command log in rcon it works fine.
but since there is no " LogPlayerInRcon(playerid); " i cannot log ppl in rcon without telling them the password...

