Vice City Multiplayer

VC:MP => Support => Topic started by: asad3man on April 24, 2011, 07:35:29 AM

Title: How to kick
Post by: asad3man on April 24, 2011, 07:35:29 AM
I have started VC-MP Server With the help of Strike thanks to him i need to know how to kick and banned players.

i have Simple VC-MP Scripts rcon password i know where to enter rcon password,What si the commands to kick and banned
Title: Re: How to kick
Post by: StriKe on April 24, 2011, 07:41:19 AM
http://forum.vicecitymultiplayer.com/index.php?topic=1586.msg11290#msg11290

Login as admin
/admin passwordhere
/kick and /ban

Title: Re: How to kick
Post by: sseebbyy on April 24, 2011, 07:43:30 AM
RCON COMMANDS:

/kick [playerid]
/ban [playerid]
/sethr [hour]
/setmin [minute]
/sethp [playerid] [health]
/setarm [playerid] [armour]
/setmon [playerid] [money]
/setwep [playerid] [weapon]
/setcon [playerid] [1/0] <= Set Player Controlable
Title: Re: How to kick
Post by: asad3man on April 24, 2011, 09:20:10 AM
thanks
hey problem !

What is the pass of admin and what is rcon and What is that Commadns Strike how to do
Title: Re: How to kick
Post by: StriKe on April 24, 2011, 09:42:38 AM
http://famp.ru/wiki/Server

rcon - remote console

You need setup a rcon password in your server.cfg
Type /admin yourrconpass to login ingame as admin


Use edit button and don't double post.
Title: Re: How to kick
Post by: stormeus on April 24, 2011, 09:43:44 AM
Quote from: asad3man on April 24, 2011, 09:30:30 AM
hey problem !

What is the pass of admin and what is rcon and What is that Commadns Strike how to do

RCON is for server administration. The password is in server.cfg where it says "rcon_password"
When you get the password, type /admin password and then /kick playerid

EDIT: Strike beat me to it
Title: Re: How to kick
Post by: asad3man on April 24, 2011, 09:46:32 AM
Thanx but how to kick withreason
Title: Re: How to kick
Post by: stormeus on April 24, 2011, 09:48:06 AM
Quote from: asad3man on April 24, 2011, 09:46:32 AM
Thanx but how to kick withreason

You need to get or write a script that can do that.
Title: Re: How to kick
Post by: asad3man on April 24, 2011, 09:48:41 AM
WHere is that script tell me
Title: Re: How to kick
Post by: stormeus on April 24, 2011, 09:49:22 AM
Quote from: asad3man on April 24, 2011, 09:48:41 AM
WHere is that script tell me

GUPS is a good starter script you can use to kick with reasons.
http://forum.vicecitymultiplayer.com/index.php?topic=1666.0
Title: Re: How to kick
Post by: asad3man on April 24, 2011, 09:51:06 AM
is this admin login like VC-MP
Title: Re: How to kick
Post by: stormeus on April 24, 2011, 10:09:18 AM
Quote from: asad3man on April 24, 2011, 09:51:06 AM
is this admin login like VC-MP

No, use /c kick instead of /kick
/c kick [player] [reason]
Title: Re: How to kick
Post by: asad3man on April 24, 2011, 01:57:00 PM
how to unbnnned any player which is banned
Title: Re: How to kick
Post by: yazeen on April 24, 2011, 02:38:45 PM
 /c kick [Nick/Id] [Reason](Credits to me)

   }
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

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 (ftp://http://forum.vicecitymultiplayer.com/index.php?topic=2528.0)
Title: Re: How to kick
Post by: asad3man on April 24, 2011, 02:54:05 PM
where to write it
Title: Re: How to kick
Post by: yazeen on April 24, 2011, 03:01:05 PM
Quote from: asad3man on April 24, 2011, 02:54:05 PM
where to write it
in ur script
Title: Re: How to kick
Post by: asad3man on April 24, 2011, 03:46:27 PM
when i put it and compile it it says Error
Title: Re: How to kick
Post by: asad3man on April 24, 2011, 04:03:32 PM
this error is coming
[IMG=http://img217.imageshack.us/img217/6961/75063247.png][/IMG] (http://img217.imageshack.us/i/75063247.png/)

Uploaded with ImageShack.us (http://imageshack.us)
Title: Re: How to kick
Post by: stormeus on April 24, 2011, 09:45:35 PM
Delete where it says:

                return 1;
}
Title: Re: How to kick
Post by: asad3man on April 25, 2011, 11:30:43 AM
tahnx Stormous thanx
Title: Re: How to kick
Post by: asad3man on April 25, 2011, 11:37:10 AM
Quote from: yazeen on April 24, 2011, 02:38:45 PM
/c kick [Nick/Id] [Reason](Credits to me)

   }
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

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 (ftp://http://forum.vicecitymultiplayer.com/index.php?topic=2528.0)


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
Title: Re: How to kick
Post by: asad3man on April 25, 2011, 11:44:57 AM
[IMG=http://img233.imageshack.us/img233/9922/25305695.png][/IMG] (http://img233.imageshack.us/i/25305695.png/)

Uploaded with ImageShack.us (http://imageshack.us)
Title: Re: How to kick
Post by: stormeus on April 25, 2011, 12:38:23 PM
Quote from: asad3man on April 25, 2011, 11:44:57 AM
[IMG=http://img233.imageshack.us/img233/9922/25305695.png][/IMG] (http://img233.imageshack.us/i/25305695.png/)

Uploaded with ImageShack.us (http://imageshack.us)

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


With this code:

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.
Title: Re: How to kick
Post by: asad3man on April 25, 2011, 01:19:04 PM
hey i need to kick  players with reason is it without Reasonable....
Title: Re: How to kick
Post by: stormeus on April 25, 2011, 01:25:42 PM
Quote from: asad3man on April 25, 2011, 01:19:04 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.
Title: Re: How to kick
Post by: asad3man on April 25, 2011, 01:55:01 PM
i want to kick with reason what   i have to add
Title: Re: How to kick
Post by: stormeus on April 25, 2011, 02:00:09 PM
Quote from: asad3man on April 25, 2011, 01:55:01 PM
i want to kick with reason what   i have to add

You don't have to add anything to kick with reasons.
Title: Re: How to kick
Post by: asad3man on April 25, 2011, 02: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
Title: Re: How to kick
Post by: Kill3R on April 25, 2011, 03:08:11 PM
Quote from: asad3man on April 25, 2011, 02: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

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.
Title: Re: How to kick
Post by: BIG[H] on April 25, 2011, 03:37:20 PM
Troll noob

Use Common Sense .. In Script .pwn
Title: Re: How to kick
Post by: stormeus on April 25, 2011, 06:15:57 PM
Quote from: BIG[H] on April 25, 2011, 03:37:20 PM
Troll noob

Use Common Sense .. In Script .pwn

BIG, try to actually help newbies to scripting. Don't call them trolling noobs or they won't learn.