Commands /report and teamchat

Started by Woodcutter, Jun 14, 2017, 06:33 PM

Previous topic - Next topic

Woodcutter

Hello, I need help in creating commands / report and / teamchat

kennedyarz

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


SAzEe21

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;
}

EK.IceFlake

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] == '\\')

Woodcutter

#4
Thanks for the help. But I had a problem - how to make the nick display the color of the team.


Mötley

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