Author Topic: How to kick  (Read 12978 times)

0 Members and 1 Guest are viewing this topic.

yazeen

  • Guest
Re: How to kick
« Reply #15 on: April 24, 2011, 04:01:05 pm »

Offline asad3man

  • Made Man
  • ***
  • Posts: 121
  • A for Asad "Lion of Allah"
    • View Profile
    • Ultra DM server Website
Re: How to kick
« Reply #16 on: April 24, 2011, 04:46:27 pm »
when i put it and compile it it says Error

Offline asad3man

  • Made Man
  • ***
  • Posts: 121
  • A for Asad "Lion of Allah"
    • View Profile
    • Ultra DM server Website
Re: How to kick
« Reply #17 on: April 24, 2011, 05:03:32 pm »

Offline stormeus

  • VC:MP Developer
  • VC:MP Veteran
  • *
  • Posts: 1122
    • View Profile
Re: How to kick
« Reply #18 on: April 24, 2011, 10:45:35 pm »
Delete where it says:
Code: [Select]
                return 1;
}
Do not PM me for support.




Offline asad3man

  • Made Man
  • ***
  • Posts: 121
  • A for Asad "Lion of Allah"
    • View Profile
    • Ultra DM server Website
Re: How to kick
« Reply #19 on: April 25, 2011, 12:30:43 pm »
tahnx Stormous thanx

Offline asad3man

  • Made Man
  • ***
  • Posts: 121
  • A for Asad "Lion of Allah"
    • View Profile
    • Ultra DM server Website
Re: How to kick
« Reply #20 on: April 25, 2011, 12:37:10 pm »
/c kick [Nick/Id] [Reason](Credits to me)

   
Code: [Select]
}
else if (strcmp(cmd, "kick", true) == 0) {
new reason[256], plr, szMsg[256];
tmp = strtok(cmdtext, idx), reason = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);
if(IsPlayerAdmin(playerid))
else if (!strlen(reason)) SendClientMessage(playerid,0xFFFF00AA,"USAGE: /c kick [Nick/ID] [Reason]");
  else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,0xFFFF00AA,"Error: Unknown player");
else {
format(szMsg,sizeof(szMsg),"Admin: %s kicked player:[ %s ] Reason:[ %s ]",gPlayers[playerid],gPlayers[plr],cmdtext[strlen(tmp)+6]);
SendClientMessageToAll(0xFFFF00AA,szMsg);
Kick(plr);
}

If u Dont Have FindPlayerIdFromString Function Add it  (Credits to bakasan

Code: [Select]
public FindPlayerIDFromString(string[])
{// for determining player id from a string  -bakasan
new player = INACTIVE_PLAYER_ID;
new p = 0;
while (p < MAX_PLAYERS) { if (strfind(gPlayers[p],string,true) != -1) { player=p;break; } p++; }
if (player == INACTIVE_PLAYER_ID) {// string didnt match so check if it can be an id
if ((strlen(string) > 2) || (isnumeric(string) == 0)) { return INACTIVE_PLAYER_ID; }
player = strval(string);// string is numeric and not more than 2 digits
}
if (!IsPlayerConnected(player)) { return INACTIVE_PLAYER_ID; }
return player;// valid id found
}
return 1;
}

Unban/Ban Command(Credits to madara)
UnBan/Ban By madara


How to use these 1st one
When i am using 2nd one then reason isnot coming Why tell me i want to use 1st one When i put it it gives a huge list of error
« Last Edit: April 25, 2011, 12:42:07 pm by asad3man »

Offline asad3man

  • Made Man
  • ***
  • Posts: 121
  • A for Asad "Lion of Allah"
    • View Profile
    • Ultra DM server Website
Re: How to kick
« Reply #21 on: April 25, 2011, 12:44:57 pm »

Offline stormeus

  • VC:MP Developer
  • VC:MP Veteran
  • *
  • Posts: 1122
    • View Profile
Re: How to kick
« Reply #22 on: April 25, 2011, 01:38:23 pm »
[IMG=http://img233.imageshack.us/img233/9922/25305695.png][/IMG]

Uploaded with ImageShack.us

First thing: what happened to FindPlayerIDFromString()? It looks like you completely erased it. Replace this code:
public FindPlayerIDFromString(string)
{}


With this code:
Code: [Select]
public FindPlayerIDFromString(string[])
{// for determining player id from a string  -bakasan
new player = INACTIVE_PLAYER_ID;
new p = 0;
while (p < MAX_PLAYERS)
{
if (strfind(gPlayers[p],string,true) != -1)
{
player = p;
break;
}
p++;
}
if (player == INACTIVE_PLAYER_ID) {// string didnt match so check if it can be an id
if ((strlen(string) > 2) || (isnumeric(string) == 0)) { return INACTIVE_PLAYER_ID; }
player = strval(string);// string is numeric and not more than 2 digits
}
if (!IsPlayerConnected(player)) { return INACTIVE_PLAYER_ID; }
return player;// valid id found
}

Another problem is that your code isn't in the right place. Everything between if (strcmp and Kick(plr); } should be somewhere in OnPlayerCommandText.
Do not PM me for support.




Offline asad3man

  • Made Man
  • ***
  • Posts: 121
  • A for Asad "Lion of Allah"
    • View Profile
    • Ultra DM server Website
Re: How to kick
« Reply #23 on: April 25, 2011, 02:19:04 pm »
hey i need to kick  players with reason is it without Reasonable....

Offline stormeus

  • VC:MP Developer
  • VC:MP Veteran
  • *
  • Posts: 1122
    • View Profile
Re: How to kick
« Reply #24 on: April 25, 2011, 02:25:42 pm »
hey i need to kick  players with reason is it without Reasonable....

If you get rid of this line:
else if (!strlen(reason)) SendClientMessage(playerid,0xFFFF00AA,"USAGE: /c kick [Nick/ID] [Reason]");

You won't need a reason to kick.
Do not PM me for support.




Offline asad3man

  • Made Man
  • ***
  • Posts: 121
  • A for Asad "Lion of Allah"
    • View Profile
    • Ultra DM server Website
Re: How to kick
« Reply #25 on: April 25, 2011, 02:55:01 pm »
i want to kick with reason what   i have to add

Offline stormeus

  • VC:MP Developer
  • VC:MP Veteran
  • *
  • Posts: 1122
    • View Profile
Re: How to kick
« Reply #26 on: April 25, 2011, 03:00:09 pm »
i want to kick with reason what   i have to add

You don't have to add anything to kick with reasons.
Do not PM me for support.




Offline asad3man

  • Made Man
  • ***
  • Posts: 121
  • A for Asad "Lion of Allah"
    • View Profile
    • Ultra DM server Website
Re: How to kick
« Reply #27 on: April 25, 2011, 03:40:36 pm »
when i kick  like this /kick 1 lolz then it just kick dont give reason and give me fulll COmmands of VC-MP server

Offline Kill3R

  • VC:MP Beta Tester
  • Street Thug
  • *
  • Posts: 28
  • uhm... iam n00b, what to type here???
    • View Profile
    • Hunting-Arena
Re: How to kick
« Reply #28 on: April 25, 2011, 04:08:11 pm »
when i kick  like this /kick 1 lolz then it just kick dont give reason and give me fulll COmmands of VC-MP server

You need to script if you want reason and other stuffs to be displayed, you have a choice of using Pawno / mIRC (which is obsolete atm).

/kick command is a RCON cmd, so it just kicks the player based on the given plr id, you can't display reason or any other statements over there.

Regards,
Kill3R

Offline BIG[H]

  • Made Man
  • ***
  • Posts: 159
  • Sight of light
    • View Profile
Re: How to kick
« Reply #29 on: April 25, 2011, 04:37:20 pm »
Troll noob

Use Common Sense .. In Script .pwn
Outdoor city server Administrator, FS server owner!