Quote from: 2b2ttianxiu on Jul 16, 2024, 07:59 AMDo u have discord? give me ur discord.Yes, here: ridwanrz
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: 2b2ttianxiu on Jul 16, 2024, 07:59 AMDo u have discord? give me ur discord.Yes, here: ridwanrz
Quote from: 2b2ttianxiu on Jul 13, 2024, 08:22 AMI want to make a websocket to connect my master server
But I build has some error
about LNK2001 curl
Quote from: habi on Jun 29, 2023, 11:26 PMUpdate
Fallback function 'hprint' added.
This function is aimed at Windows systems which do not support ANSI Color code.
Usage
hprint(cBLUE,"This text is colored.")
Again 7+1 color constants cBLUE, cGREEN, cYELLOW, cRED, cMAGENTA, cCYAN, cWHITE, cBOLD available.
Use +cBOLD for intensity.
hprint( cCYAN + cBOLD, "This is variation of cyan color")
Remark: This is based on the WINAPI function 'SetConsoleTextAttribute'. The first parameter of 'hprint' is passed as wAttributes to this function. So you may use various values of the latter for changing background color etc.
Binaries updated in first post.
Source of 'hprint':SQInteger fn_hprint(HSQUIRRELVM v)
and the function used:
{
const SQChar* text; SQInteger wattributes;
sq->getinteger(v, 2, &wattributes);
sq->getstring(v, 3, &text);
#ifdef WIN32
//Credits: https://bitbucket.org/stormeus/0.4-squirrel/src/master/ConsoleUtils.cpp
HANDLE hstdout = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_SCREEN_BUFFER_INFO csbBefore;
GetConsoleScreenBufferInfo(hstdout, &csbBefore);
SetConsoleTextAttribute(hstdout, wattributes);
fputs(text, stdout);
SetConsoleTextAttribute(hstdout, csbBefore.wAttributes);
#else
printf("%c[%s%sm%s%c[0m", 27, (wattributes&8)==8?"1;":"", getANSIColorCode(wattributes&(~8)), text, 27);
#endif
return 0;
}const char* getANSIColorCode(int i)
{
switch (i)
{
case 1: return "34";
case 2: return "32";
case 3: return "36";//cyan
case 4: return "31";//red
case 5: return "35";//magenta
case 6: return "33";//yellow
case 7: return "37";//white
default: return "";
}
}
hprint( cCYAN + cBOLD, "This is variation of cyan color "+ cYELLOW + cBOLD +"Yellow");
Quote from: Malik GT on Jul 07, 2023, 05:37 PMsir its not work can you tell me on discord Malik GT #6646 or any social media because i want this on my server pls reply fast
Thank you
Quote from: Yuriitwo on Aug 04, 2023, 10:09 AMThe error occurred because the variable 'cp' is directly receiving the text of the checkpoint (the command 'local cp = text;' is assigning 'text' directly to the variable 'cp'). However, to remove a checkpoint, you need the checkpoint object that was created earlier, not the string with the representation of the 'CreateCheckpoint' command.
else if ( cmd == "addcp")
{
local PosX = player.Pos.x;
local PosY = player.Pos.y;
local PosZ = player.Pos.z;
local newline;
CreateCheckpoint(null, 1, true, Vector(PosX.tofloat() , PosY.tofloat() , PosZ.tofloat()), ARGB(255,255,255,255), 2);
MessagePlayer("[#FFFFFF]Check point has been created.!", player);
MessagePlayer("CreateCheckpoint(null, 1, true, Vector("+ PosX.tofloat() +", " + PosY.tofloat() + ", "+ PosZ.tofloat() +", ARGB(255,255,255,255), 2);", player);
print("CHECKPOINT: " + PosX + ", " + PosY + ", " + PosZ);
newline = "CreateCheckpoint(null, 1, true, Vector("+ PosX.tofloat() +", " + PosY.tofloat() + ", "+ PosZ.tofloat() +", ARGB(255,255,255,255), 2); \n";
local f = file("savedcp.txt","a+");
foreach (c in newline)
f.writen(c, 'b');
f.close();
}
else if ( cmd == "delcp")
{
if (text)
{
local cp = text;
cp.Remove()
MessagePlayer("[#FFFFFF]Check point has been removed!", player);
}
else
{
MessagePlayer("[#FFFFFF]write something to remove cp!", player);
}
}
AN ERROR HAS OCCURED [the index 'Remove' does not exist]
CALLSTACK
*FUNCTION [onCommand()] scripts/_MapperSystem.nut line [566]
*FUNCTION [onPlayerCommand()] scripts/main.nut line [1961]
LOCALS
[cp] "CreateCheckpoint(null, 1, true, Vector(-1730.41, -154.432, 14.9084, ARGB(255,255,255,255), 2);"
[text] "CreateCheckpoint(null, 1, true, Vector(-1730.41, -154.432, 14.9084, ARGB(255,255,255,255), 2);"
[cmd] "delcp"
[player] INSTANCE
[this] TABLE
[text] "CreateCheckpoint(null, 1, true, Vector(-1730.41, -154.432, 14.9084, ARGB(255,255,255,255), 2);"
[cmd] "delcp"
[player] INSTANCE
[this] TABLE
Quote from: habi on Aug 03, 2023, 09:44 AMthat's exactly thing I was looking for, thanks man! I thought it was server-side, but turned to be client side, which I have zero knowledge for. Nevertheless, I'll be using this.Stream.WriteByte(100);
Are you using blank server?
Stream.WriteString("www.google.com");
Stream.SendStream(player);//store/script/main.nut
function Server::ServerData(stream)
{
...
case 100: local link= stream.ReadString();
::System.SetClipboardText(link);
break;
}