It looks very good, good job <3
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuote from: Razor. on Feb 11, 2021, 12:40 AMGreat work!
Quote from: Gito Baloch on Feb 11, 2021, 03:36 AMWelldone bro!!!
Quote from: Sebastian on Feb 11, 2021, 09:08 AMCan you provide screenshots/video ?
OBJ_DB <- ConnectSQL( "Objects.db" );
dofile( "scripts/timersystem.nut" );
dofile( "scripts/_MapperSystem.nut" );
Mapper.LoadSystem()
::Mapper.onCommand( player, cmd, text )
::Mapper.onObjectShot(player, object)
function GetTok(string, separator, n, ...)
{
local m = vargv.len() > 0 ? vargv[0] : n,
tokenized = split(string, separator),
text = "";
if (n > tokenized.len() || n < 1) return null;
for (; n <= m; n++)
{
text += text == "" ? tokenized[n-1] : separator + tokenized[n-1];
}
return text;
}
Quote from: =RK=MarineForce on Mar 25, 2020, 10:40 AMIndex Timer Does not exists wtf?
Quote from: rww on Mar 01, 2019, 04:00 PMU can get correct vehicle angle by this scriptfunction CVehicle::GetRadiansAngle() //by Gudio
{
local angle = ::asin(this.Rotation.z) * -2;
return this.Rotation.w < 0 ? 3.14159 - angle : 6.28319 - angle;
}
I never get problems with values from this code
Example, how to get correct angle by /pos command
onPlayerCommands event:local veh = player.Vehicle;
if (cmd == "pos")
{
if (!veh) ClientMessage("* Your Cords:[#ffffff] "+player.Pos.x+", "+player.Pos.y+", "+player.Pos.z+", "+player.Angle,player,128,255,0,255);
else ClientMessage("* Your Vehicle Cords:[#ffffff] "+player.Pos.x+", "+player.Pos.y+", "+player.Pos.z+", "+veh.GetRadiansAngle(),player,128,255,0,255);
ClientMessage("* Virtual World:[#ffffff] "+player.World+" [#80ff00]/ Sec World:[#ffffff] "+player.SecWorld+" [#80ff00]/ Unique World: [#ffffff]"+player.UniqueWorld,player,128,255,0,255);
}
Quote from: Doom_Kill3R on Feb 21, 2020, 07:34 AMSockets can be used for other stuff than just IRC yes, but you need to basically understand how they work and what to do with the requests and responses, although I never tried it.Thank you very much for explaining and commenting.
Quote from: Luckshya on Feb 21, 2020, 07:56 AMI have used sockets for HTTP requests but I had to create sockets everytime to send a request. So I created that simple plugin for that.I will use your module Thank you very much
Maybe try this: https://forum.vc-mp.org/?topic=7522.0
And you can use JSON parser to parse the json string to squirrel data using some available parser like https://github.com/electricimp/JSONParser
Quote from: JackSparrow on Jan 16, 2020, 04:14 AMWe can't ban this tag plr =FF= but we can ban this tag plr [FF]any error in the console?
Quote from: Kelvinvenema on Dec 25, 2019, 02:14 PMQuote from: Maximiliano on Dec 25, 2019, 02:07 PMYou can create a function and then you use the NewTimer function:i don't know that that works in my example
NewTimer (Function, Milliseconds, Number of times to be repeated, function parameters);
Example:function Test( player )
1000 miliseconds = 1 second. 2 = Number of times to be repeated. - player = function parameters
{
MessagePlayer("Timer working correctly", player);
}
NewTimer("Test", 1000, 2, player);
Another example:function GotoPlayer( player, player2 )
3000 miliseconds = 3 second. 1 = Number of times to be repeated. - player, player2 = function parameters.
{
player.Pos = player2.Pos;
MessagePlayer("You has teleported to " + player2.Name + ".", player);
}
NewTimer("GotoPlayer", 3000, 1, player, player2);
for example i will use
a command like fixvehicle
how do i add a cooldown so that players can only use this command every 10m
your example doesn't give me the lines i can use.
CommandsUsed <- array( GetMaxPlayers(), []);
function onPlayerCommand( player, cmd, text )
{
if ( cmd.tolower() == "fix" )
{
if ( CommandsUsed[ player.ID ].find("fix") ) MessagePlayer("You can't use this command in this time. (Wait approximately less than 10 minutes) ",player);
else
{
//Your code here...
CommandsUsed[ player.ID ].push( "fix" );
NewTimer("CommandRelease", 600000, 1, player, cmd);
}
}
}
function CommandRelease(player, cmd) //This will eliminate the array command, so the player can use it again
{
if ( CommandsUsed[ player.ID ].find( cmd ))
{
local position = CommandsUsed[ player.ID ].find( cmd );
CommandsUsed[ player.ID ].remove(position);
}
}
It's untested XD
function Test( player )
{
MessagePlayer("Timer working correctly", player);
}
NewTimer("Test", 1000, 2, player);
1000 miliseconds = 1 second. 2 = Number of times to be repeated. - player = function parametersfunction GotoPlayer( player, player2 )
{
player.Pos = player2.Pos;
MessagePlayer("You has teleported to " + player2.Name + ".", player);
}
NewTimer("GotoPlayer", 3000, 1, player, player2);
3000 miliseconds = 3 second. 1 = Number of times to be repeated. - player, player2 = function parameters.