Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Woodcutter on Jun 14, 2017, 06:33 PM

Title: Commands /report and teamchat
Post by: Woodcutter on Jun 14, 2017, 06:33 PM
Hello, I need help in creating commands / report and / teamchat
Title: Re: Commands /report and teamchat
Post by: kennedyarz on Jun 14, 2017, 06:48 PM
Let's talk about report

For this you must create a database. example:
 QuerySQL(db, "CREATE TABLE IF NOT EXISTS Objects ( Name VARCHAR(255), prl VARCHAR(255),  Reason VARCHAR(255), Data NUMERIC  )" );
Then do a command /report <Name> reason

Title: Re: Commands /report and teamchat
Post by: SAzEe21 on Jun 15, 2017, 05:06 AM
if ( text.slice(0,1) == "\\" )
{
local text = text.slice(1);
for ( local i = 0; i < GetMaxPlayers(); i++ )
{
local plr = FindPlayer( i );
if ( plr && plr.Team == player.Team )
{
MessagePlayer("[TeamChat] "+player.Name+": "+text,plr);
}
}
return 0;
}
Title: Re: Commands /report and teamchat
Post by: EK.IceFlake on Jun 15, 2017, 01:26 PM
Quote from: Zeeshan.Bhatti on Jun 15, 2017, 05:06 AMif ( text.slice(0,1) == "\" )
This might (read: will) be more efficient:
if (text[0] == '\\')
Title: Re: Commands /report and teamchat
Post by: Woodcutter on Jun 15, 2017, 02:35 PM
Thanks for the help. But I had a problem - how to make the nick display the color of the team.

(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fsavepic.ru%2F14450042.jpg&hash=bd9b76f6ade3a838f3854d9a60fbe21578d7255a)
Title: Re: Commands /report and teamchat
Post by: Mötley on Jun 15, 2017, 06:46 PM
I believe you use
AddClass( 1, RGB( 24, 255, 241 ) ,0, Vector( -378.79, -537.962, 17.2832 ), 140.020, 21, 999 ,1, 1, 25, 255 );In the scripts manually to achieve proper team colors during chat

http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Functions/AddClass