03.06.2012, 13:49
Hey!
My /kick cmd doesn't work. Actually, working with ID 0 only. Can someone repair it? THANKS!
And reason doesn't work too. ;/
This is Admin and VIP player (Mod) code:
My /kick cmd doesn't work. Actually, working with ID 0 only. Can someone repair it? THANKS!
And reason doesn't work too. ;/
This is Admin and VIP player (Mod) code:
pawn Код:
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;
}