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.

Topics - karan20000000000
1
Off-Topic General / Whats up with all those guests?
« on May 28th, 2017, 05:36 PM »
http://forum.vc-mp.org/?action=who
Whats wrong with all those guests choosing skins?
Are those bots?
2
Videos & Screenshots / Poor man's rocket league
« on November 1st, 2016, 05:25 PM »
Here's a little script I made few months ago:

https://www.youtube.com/watch?v=1nc5a6LuLt0#
3
This is crazy, https://haveibeenpwned.com
I don't know how many of you know about this but its pretty useful.
4
Off-Topic General / *cough cough*
« on July 23rd, 2016, 05:00 PM »
Quote from Stormeus
Flooding the board with separate requests for many disparate items is not allowed.
If you need a whole set of things for your server, you should list them all in one thread rather than spamming this board with fifteen threads about each of the things you want your server to do.
5
I added a variable to player's class, joined the server and tried to edit the value of the variable in runtime and it didn't change. It seems as if its behaving like a constant variable.
Code: [Select]
CPlayer.newmember("ispig",true,null,false);
function onPlayerJoin(player)
{
player.ispig = false;
print(player.ispig); //prints true
}

Any help or theoretical explanations as to why is this happening would be appreciated.
6
Description
/msg sends only one word to the recepient (noticed by PunkNoodle (@...kneedl_) first).
"Injected thread hung" pops up every now and then not just for me but a couple of others as well.

Reproducible
Always

What you were doing when the bug happened
Playing in maxorator's 04rel004 test server.

What you think caused the bug
04rel004 update
7
Off-Topic General / Making collisions through blender
« on April 19th, 2016, 03:25 PM »
Is there any way to generate collisions through blender for an object?
I've tried exporting the object as .obj, .dff, .3ds but all of them showed errors (invalid file format, non standard dff, etc) in gmax probably due to large size of the object. [Note: I did triangulate the faces of the object before exporting.]
I also tried setting the collision type to autogenerate, the object appeared but the collisions didn't seem to work for this one probably because of huge number of faces (around 55k :P)
I searched google to generate collisions through colleditor but neither were there any tutorials nor did the official website show up the documentation page.
8
Snippet Showroom / XTextdraw [added stuff to textdraws]
« on December 13th, 2015, 06:42 PM »
The topic itself is self explanatory; a couple of features have been added to textdraws.
Code: [Select]
XTextdraw
     .ID         //ID of xtxd instance
     .text      //The text to be displayed
     .pos      //The array containing x,y coord of txd
     .col       //The hex color of txd.
     .obj      //The actual textdraw instance
     .players  //An array containing players to which an instance of xtextdraw is being visible
     .ShowForAll()
     .ShowForPlayer(player)
     .HideFromAll()
     .HideFromPlayer(player)
     .SetRelativeForAll(boolean)
     .Delete()

 CreateXTextdraw(text,x,y,colour)
 FindXTextdraw(id)

An example to illustrate above functions:
Code: [Select]
CreateXTextdraw("momo",400,500,0xFFFFFFFF);
local hi = FindXTextdraw(0);
hi.pos[1]-=10;
hi.col=0xFF3445FF;

I didn't add  Textdraw.SetPosForAll, Textdraw.SetPosForPlayer, Textdraw.SetColourForAll, Textdraw.SetColourForPlayer because they will require a different approach. In case you use them, try modifying the code yourself.
Since this is the very first release, so there could be a couple of bugs. Just put them down.
Link to snippet: clicky
(click to show/hide)
Code: [Select]
class XTxd
{
    text = null;
    ID = null;
    pos = null;
    col = null;
    obj = null;
    players = null;
    isvta = false;
    isrfa = false;

    //static for these
    count = [0];
    timer = [null];
    objs = [];

    constructor(str,x,y,colr) {
      count[0]++;
      if(pos==null)
      {
        pos = [0,0];
        players = [];
      }
      text = str;
      pos = [x,y];
      col = colr;
      obj = ::CreateTextdraw(str,x,y,colr);

      local did=false;
      for(local i=0;i<XTxd.objs.len();i++)
      {
        local dat = XTxd.objs[i];
        if(dat==null)
        { XTxd.objs[i] = this; did=true; ID = i; break; }
      }
      if(did!=true)
      {
        XTxd.objs.push(this);
        ID = XTxd.objs.len()-1;
      }

      if(count[0] == 1)
      {
        timer[0] = ::NewTimer("ref",1000,0);
      }

    }

    static function refresh()
    {
      for(local i=0;i<objs.len();i++)
      {
        local o =   objs[i];
        if(o!=null)
        {
            o.obj.Delete();
            o.obj = ::CreateTextdraw(o.text,o.pos[0],o.pos[1],o.col);
            o.obj.SetRelativeForAll(o.isrfa);
            if(o.isvta==true) o.obj.ShowForAll();
            else if(o.players.len()>0)
            {
              foreach (plr in o.players)
               {
                o.obj.ShowForPlayer(plr);
               }
            }
        }
      }
    }

    function ShowForPlayer(player)
    {
      players.push(player);
    }
    function ShowForAll()
    {
      isvta = true;
    }
    function HideFromPlayer(player)
    {
      if(players.find(player)!=null)
      {
        players.remove(players.find(player));
      }
    }
    function HideFromAll()
    {
      isvta = false;
    }
    function SetRelativeForAll(val)
    {
      isrfa = val;
    }
    function Delete()
    {
      obj.Delete();
      objs[ID] = null;
      --count[0];
    }

}

function CreateXTextdraw(str,x,y,col)
{
  return XTxd(str,x,y,col);
}
function FindXTextdraw(id)
{
  for(local i=0;i<XTxd.objs.len();i++)
  {
    if(XTxd.objs[i]!=null && id == XTxd.objs[i].ID) return XTxd.objs[i];
  }
  return null;
}

function ref()
{
  XTxd.refresh();
}
9
Videos & Screenshots / Funny Pics :D
« on May 6th, 2015, 06:43 PM »
Post ur pics here!

Mine:
I believe I can fly! :D


10
Script Showroom / [FilterScript] Map Editing Script
« on April 21st, 2015, 05:18 PM »
Hello guys, I've been working on this script for a while because I was unable to use the map editing software(MEd,KED,etc).
So here's the download link:

How to install:-
Extract all the files from the .rar file into a folder. Add the plugins, server configuration files and the server.

How to use:-
Before starting to perform map editing through this script I recommend you to remove arrow keys from ped control or wasd keys whichever you don't use for controlling you ped.

Commands: /co <id>      //create an object with the specific id
                    /wasd          //set the object editing keys to wasd
                    /arrows        //set the object editing keys to arrow keys
                    /loadautosaved         //loads the objects from autosaved section in objects.ini

The arrow keys are used for editing by default. If you want to use wasd for editing then type /wasd.

Editing keys:
Disable/Enable editing = `           //Key above tab button
Enable x,y editing coords = f1
Then use arrow keys.
 
Enable z editing coord = f2
Then use up and down arrow key.
 
Enable angle editing = f3
Then use arrow keys, [ and ] .    //[ and ] are used for horizontal rotation. [ and ] are the keys right next to P button

Toggle relative positioning on/off = 1  //Not the numpad key. Key 1 above Q
 
Print statement for selected object = P
Replicating selected object = L
 
Delete selected object = delete key
Select object = shoot with any gun.

After you select an object and press print key(P) then a CreateObject statement will be printed on the console and to object.ini somewhat like this:
[SCRIPT]  CreateObject(562,1,Vector(-335.557, -517.293, 12.7957),255).RotateToEuler(Vector(0, 0, -1.55),1);

If you want to print details through an echobot to  print details to irc then you may also attach an echo.nut file but I haven't supplied the echobot file.

One more thing, you may need not tap an editing button again and again. You can just press and hold it.

Enjoy mapping your server with your friends.

UPDATE- v2
1)Added relative repositioning of objects. Now you can reposition objects very easily because now objects will move in the way you're seeing them. Use key 1 to toggle relative positioning on/off. Its turned on by default.
2)All the objects that are saved in the objects.ini are automatically reloaded on server start!

UPDATE- v3
1) Added autosave feature! Use /loadautosaved to load all objects from autosaved section in objects.ini
2) Added better method of changing object's angles which is simple and wayyy less confusing.

Version 1 download link- Mapping.zip
Version 2 download link- Mappingv2.rar
11
Closed Bug Reports / [Event bugged] onObjectShot()
« on April 17th, 2015, 04:17 PM »
This event seems to be giving wrong information as well as useless errors.
For example i created three objects and enabled their TrackingShots in a test script with the model and id as follows:
Code: [Select]
440, ID: 0
440, ID: 1
440, ID: 2
And onObjectShot event as follows:
Code: [Select]
function onObjectShot(player,object,weapon)
{
  print(object.Model+",.. ID: "+object.ID);
}
And then this was the output:
Code: [Select]
AN ERROR HAS OCCURED [Member Variable not found]
CALLSTACK
*FUNCTION [onObjectShot()] testing.nut line [142]
LOCALS
[weapon] 17
[object] INSTANCE
[player] INSTANCE
[this] TABLE


After this i changed the code in the event a bit as follows:
Code: [Select]
function onObjectShot(player,obje,weapon)
{
  local object = FindObject(obje.ID);
  print(object.Model+",.. ID: "+object.ID);
}

This time there were no errors in console but every time I shot any object, the model id and the ID of the  first object was being printed in console and the model id and ID of that new object was not being printed.
Output when I created objects:
Code: [Select]
[SCRIPT]  440, ID: 0
[SCRIPT]  450, ID: 1
[SCRIPT]  460, ID: 2

Output when I shot the objects:
Code: [Select]
[SCRIPT]  440,.. ID: 0
[SCRIPT]  440,.. ID: 0
[SCRIPT]  440,.. ID: 0
12
General Discussion / Small icon in forum O..o
« on March 1st, 2015, 09:31 AM »
I've been noticing this from past two to three days. :o
13
Snippet Showroom / Hotkeys system :)
« on October 19th, 2014, 06:14 AM »
Hello. My first post ^_^
Hope you'll like it ;)
Ok so first under onScriptLoad you'll need to create some global variables which will represent keybindings using BindKey function.
Code: [Select]
<variable> <- BindKey(boolean value,hex code,some integer value(keep it 0),0 here too);
Well idk whats that boolean value for so keep true as default one.
For hex codes use this website --> http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx
So, here are some of my key bindings
Code: [Select]
onScriptLoad() {
 I <- BindKey(true, 0x49, 0, 0);
   H <- BindKey(true, 0x48,0,0);
   P <- BindKey(true, 0x50,0,0);
   K <- BindKey(true, 0x4B,0,0);
   L <- BindKey(true, 0x4C,0,0); }
Now, to use these keybindings you have onKeyDown function.
Code: [Select]
Syntax: onKeyDown(player,key)
Now you can simply use your keybindings through their respective variables through switch-case or if-else if.
Here's mine for nitro :
Code: [Select]
  function onKeyDown(player,key)
{
if(key==I)
{ if(player.Vehicle!=null) { local v=player.Vehicle; v.RelativeSpeed*=1.3;} }
}
Hope you like this ^_^.