[GameMode] My DM [GM]
#10

Quote:
Originally Posted by ilikenuts
View Post
Thx AnyWay And i'll Try To Fix This In Next Update
just do like this...:
pawn Code:
if(strcmp(cmd, "/kick", true) == 0){
new tmp[256];
tmp = strtok(cmdtext, idx);
if(strlen(tmp)){
SendClientMessage(playerid, COLOR_ORANGE, "Usage: /kick [playerid]");
return 1;
}
new victim;
victim = strval(tmp);
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
new playername2[MAX_PLAYER_NAME];
GetPlayerName(victim, playername2, sizeof(playername2));
new string[128];
format(string, sizeof(string), "The Admin %s kicked you!", playername);
SendClientMessage(victim, COLOR_RED, string);
Kick(victim);
format(string, sizeof(string), "You kicked %s", playername2);
SendClientMessage(playerid, COLOR_RED, string);
format(string, sizeof(string), "The Admin %s Kicked the player %s", playername, playername2);
SendClientMessageToAll(COLOR_RED, string);
return 1;
}
but if you want to make the command with a reason...:
pawn Code:
if(strcmp(cmd, "/kick", true) == 0){
new tmp[256], tmp2[256];
tmp = strtok(cmdtext, idx);
tmp2 = strtok(cmdtext, idx);
if(strlen(tmp)){
SendClientMessage(playerid, COLOR_ORANGE, "Usage: /kick [playerid] [reason]");
return 1;
}
if(strlen(tmp2)){
SendClientMessage(playerid, COLOR_ORANGE, "Usage: /kick [playerid] [reason]");
return 1;
}
new victim, reason;
victim = strval(tmp);
reason = strval(tmp2);
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
new playername2[MAX_PLAYER_NAME];
GetPlayerName(victim, playername2, sizeof(playername2));
new string[128];
format(string, sizeof(string), "The Admin %s kicked you! reason: %s", playername, cmdtext[6]);
SendClientMessage(victim, COLOR_RED, string);
Kick(victim);
format(string, sizeof(string), "You kicked %s. reason: %s", playername2, cmdtext[5]);
SendClientMessage(playerid, COLOR_RED, string);
format(string, sizeof(string), "The Admin %s Kicked the player %s. reason: %s", playername, playername2, cmdtext[6]);
SendClientMessageToAll(COLOR_RED, string);
return 1;
}
hope i helped... it is suppose to work... tell me if there are any bugs!
Reply


Messages In This Thread
Removed - by ilikenuts - 06.02.2011, 13:54
Re: My DM [GM] - by Macintosh - 06.02.2011, 16:48
Re: My DM [GM] - by Curti$ - 06.02.2011, 17:08
Re: My DM [GM] - by Mean - 06.02.2011, 17:13
Re: My DM [GM] - by Macintosh - 06.02.2011, 17:37
Re: My DM [GM] - by Maftaca - 06.02.2011, 17:46
Re: My DM [GM] - by Kruger - 06.02.2011, 23:03
Re: My DM [GM] - by Ash. - 08.02.2011, 18:41
Re: My DM [GM] - by ilikenuts - 09.02.2011, 11:55
Re: My DM [GM] - by omer5198 - 06.03.2011, 15:07

Forum Jump:


Users browsing this thread: 1 Guest(s)