Hello, I need help in creating commands / report and / teamchat
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
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;
}
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] == '\\')
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)
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