Vice City: Multiplayer

VC:MP Discussion => Support => Topic started by: kokia on Jul 19, 2015, 11:43 AM

Title: can i have small help
Post by: kokia on Jul 19, 2015, 11:43 AM
hello all today i downloaded the console plugin from ysc and added a chat command that command works fine but i wanted the player chat to also show in the console then onplayerchat i wrote this
print("** " + player.Name + " : " + text + " . " **);
and it is giving error that expression expected is my code not working or this is not the way to do it if it is not the way then please tell me the right way
thanks for help
Title: Re: can i have small help
Post by: KingOfVC on Jul 19, 2015, 11:46 AM
change to
print("** " + player.Name + " : " + text + " . " );
Title: Re: can i have small help
Post by: kokia on Jul 19, 2015, 11:57 AM
thank you and another thing please tell me how can i make a function in whenever a player types a command it shows in console?
Title: Re: can i have small help
Post by: Mashreq on Jul 19, 2015, 12:56 PM
Quote from: kokia on Jul 19, 2015, 11:57 AMthank you and another thing please tell me how can i make a function in whenever a player types a command it shows in console?
Thats what you have posted in the starting of your post which is print, using print if you type any text it will get printed to your server console for example.
print( "i'm kokia." );
Title: Re: can i have small help
Post by: KingOfVC on Jul 19, 2015, 01:38 PM
Quote from: kokia on Jul 19, 2015, 11:57 AMthank you and another thing please tell me how can i make a function in whenever a player types a command it shows in console?


function onPlayerCommand(player,cmd,text)
{
print("CMD ["+player.Name+"] "+ cmd + " " +text)
}
Title: Re: can i have small help
Post by: Alterito on Jul 19, 2015, 02:15 PM
Quote from: kokia on Jul 19, 2015, 11:43 AMhello all today i downloaded the console plugin from ysc and added a chat command that command works fine but i wanted the player chat to also show in the console then onplayerchat i wrote this
print("** " + player.Name + " : " + text + " . " **);
and it is giving error that expression expected is my code not working or this is not the way to do it if it is not the way then please tell me the right way
thanks for help
do you want to steal a password by doing this
Title: Re: can i have small help
Post by: kokia on Jul 19, 2015, 02:28 PM
Quote from: subhamrocks on Jul 19, 2015, 02:15 PM
Quote from: kokia on Jul 19, 2015, 11:43 AMhello all today i downloaded the console plugin from ysc and added a chat command that command works fine but i wanted the player chat to also show in the console then onplayerchat i wrote this
print("** " + player.Name + " : " + text + " . " **);
and it is giving error that expression expected is my code not working or this is not the way to do it if it is not the way then please tell me the right way
thanks for help
do you want to steal a password by doing this
no i just want it because in my server people spam commands and i wanna see from console and ban them