Show posts

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 Menu

Messages - Ridwan Rz

Community Plugins / Re: logfile maker
Sep 25, 2023, 03:37 AM
Seems the plugin doesn't work anymore. Code 126 ERROR.
Community Plugins / Re: Console Color Plugin
Aug 29, 2023, 06:15 AM
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.

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)
    const SQChar* text; SQInteger wattributes;
    sq->getinteger(v, 2, &wattributes);
    sq->getstring(v, 3, &text);

#ifdef WIN32
    HANDLE hstdout = GetStdHandle(STD_OUTPUT_HANDLE);

    GetConsoleScreenBufferInfo(hstdout, &csbBefore);
    SetConsoleTextAttribute(hstdout, wattributes);
    fputs(text, stdout);
    SetConsoleTextAttribute(hstdout, csbBefore.wAttributes);
    printf("%c[%s%sm%s%c[0m", 27, (wattributes&8)==8?"1;":"", getANSIColorCode(wattributes&(~8)), text, 27);

    return 0;
and the function used:
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 "";

can you help me out here?

I did like this:
hprint( cCYAN + cBOLD, "This is variation of cyan color "+ cYELLOW + cBOLD +"Yellow");
Output was: This is variation of cyan color 68Yellow

the yellow text is not a yellow colour yet
Community Plugins / Re: Console Color Plugin
Aug 28, 2023, 07:10 PM
Why I didn't came across this? I also talked about this to you on discord! You're amazing habi! Well done!
Community Plugins / Re: New curl plugin
Aug 18, 2023, 04:27 AM
A Noob Question: What can you do with this?
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

Open a different thread and post the problem. and also that discord plugin kinda outdated, so I don't know if it's gonna work again. I suggest you to check Aroli's ADiscord.
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.

Thank you @Yuriitwo That is a perfect explanation for me to understand what I did incorrectly and wrong. Thank you again.
Hey there, The idea was to add checkpoints temporarily and removing them if the placement is not correct, so that I can understand where I'm putting while I'm mapping.

So far I'm using this:
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');
else if ( cmd == "delcp")
  if (text)
    local cp = text;
    MessagePlayer("[#FFFFFF]Check point has been removed!", player);
    MessagePlayer("[#FFFFFF]write something to remove cp!", player);

So the thing is I copy the CreateCheckpoint whole created function from /addcp and paste it on /delcp (pasting the checkpoint).

So I'm not sure I'm not doing it correctly. I know I'm not that good at scripting but trying to learn.

I can add perfectly but it's not deleting anything using /delcp.

The ERROR on console:
AN ERROR HAS OCCURED [the index 'Remove' does not exist]
*FUNCTION [onCommand()] scripts/_MapperSystem.nut line [566]
*FUNCTION [onPlayerCommand()] scripts/main.nut line [1961]
[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 AMStream.WriteByte(100);
Are you using blank server?
function Server::ServerData(stream)
case 100: local link= stream.ReadString();

that'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.
Script Showroom / Re: Multi-Language System
Aug 04, 2023, 03:08 AM
Thanks for the language system yuriitwo,  I was about to ask you about this on DC. :DD
I'm interested in a function that allows instant link copying using a /discord command. When the command is executed, the link should be copied to the clipboard, enabling easy pasting onto a website.
Holy heaven! Good job mate! It's going to help newbies like me for a starting point in this type of Gamemode :D
It's time to make some noise huh?  ;D  ;D
Script Showroom / Re: Server Builder
Apr 30, 2023, 03:24 AM
Quote from: PSL on Apr 29, 2023, 03:06 AMHere's the link to the update:
This script mainly creates maps and hope you can have a good time.

Thanks for sharing the updated link!
Quote from: PSL on Apr 29, 2023, 03:09 AMThe problem has been solved. Thank you all for your help.

Hey, mind telling us the solution? It would be helpful for those who trying to remove crouch as well :D
Script Showroom / Re: Crew/Gang sys-
Apr 30, 2023, 03:16 AM
Quote from: H.a.S.a.N on Apr 29, 2023, 08:16 AMAN ERROR HAS OCCURED [parameter 1 has an invalid type 'null' ; expected: 'userdata']
*FUNCTION [onScriptLoad()] scripts/main.nut line [128]
*FUNCTION [unknown()]  line [1]
[this] TABLE
[gamemode_event] CLOSURE
[filterscript_event] NATIVECLOSURE
[this] TABLE
This error

Hasan, I think you better show the line code. I don't know what is the part of code is causing it.