CMD:kick(playerid, params[])
{
if(Donator[playerid]) {
new PID; //define the playerid we wanna kick
new reason[64]; //the reason, put into a string
new str[128]; //a new message string
new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME]; //defines the function with the playername we wanna get
GetPlayerName(playerid, Adminname, sizeof(Adminname)); //defines the function with the adminname we wanna get
GetPlayerName(PID, Playername, sizeof(Playername));
if(!IsPlayerConnected(PID)) // if the ID is wrong or not connected, return a message! (PID used here)
return SendClientMessage(playerid, RAUDONA, "Ћaidėjas neprisijungęs!");
format(str, sizeof(str), "%s buvo iљmestas iљ serverio administratoriaus %s. Prieћastis: %s ", Playername, Adminname, reason); //format the string we've defined to send the message, playername and adminname are used to receive the information about the names
SendClientMessageToAll(RAUDONA, str); //send that message to all
Kick(PID); //kick the playerid we've defined
}
else //if he has not got the permissions
if(Moderas[playerid]) {
new PID; //define the playerid we wanna kick
new reason[64]; //the reason, put into a string
new str[128]; //a new message string
new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME]; //defines the function with the playername we wanna get
GetPlayerName(playerid, Adminname, sizeof(Adminname)); //defines the function with the adminname we wanna get
GetPlayerName(PID, Playername, sizeof(Playername));
if(!IsPlayerConnected(PID)) // if the ID is wrong or not connected, return a message! (PID used here)
return SendClientMessage(playerid, RAUDONA, "Ћaidėjas neprisijungęs!");
format(str, sizeof(str), "%s buvo iљmestas iљ serverio VIP ћaidėjo %s. Prieћastis: %s ", Playername, Adminname, reason); //format the string we've defined to send the message, playername and adminname are used to receive the information about the names
SendClientMessageToAll(RAUDONA, str); //send that message to all
Kick(PID); //kick the playerid we've defined
}
return 1;
}
COMMAND:kick(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
if(PlayerInfo[playerid][pAdminDuty] == 1)
{
new pID, reason[64];
if(!sscanf(params, "us", pID, reason))
{
new string[128];
new adminname[MAX_PLAYER_NAME];
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, adminname, sizeof(adminname));
GetPlayerName(pID, playername, sizeof(playername));
format(string, sizeof(string), "AdmCmd: %s has been kicked by %s, Reason:%s", playername, adminname, reason);
SendClientMessageToAll(COLOR_RED, string);
Kick(pID);
}
else return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /kick [PlayerID/PartOfName] [Reason]");
}
else return SendClientMessage(playerid, COLOR_GREY, "You need to be on admin duty in order to use this feature (/aduty)");
}
else return SendClientMessage(playerid, COLOR_GREY, ".:: You are not authorised to use this command ::.");
return 1;
}
Have some errors in line number 3 (in your code)
error 001: expected token: ")", but found "[" error 029: invalid expression, assumed zero error 017: undefined symbol "pAdmin" fatal error 107: too many error messages on one line It's possible to repair my code? |
enum pInfo
{
pAdmin
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Dude, I know, this annoying, but I'm green in pawno.. Can you give me a normal/working code? Or edit my old one.
|