Recent Posts

Pages: 1 ... 6 7 [8] 9 10
71
Script Releases / Re: Mansion Gate
« Last post by sseebbyy on October 12, 2014, 12:19:33 am »
By releasing this script to the public, you will help many newbies. :)
(I would use a class to create these gates, to make it easier, instead of this way)
But...  there is a problem. What happens if the gate is not id 0 ?Another object will move instead of the gate.

To fix that, note the object with an word like "mansiongate".
How you do that ? Like this:
Code: [Select]
mansiongate <- CreateObject(6000,0,Vector(-277, -495, 10),255);
Then you simply move it using:
Code: [Select]
mansiongate.MoveBy(Vector(-8,0,0), 2800);


By the way, it's good that it uses a global function as "MoveGate", for closing/opening the gate.
I suggest you to add one more parameter that will represent the gate (object), so you can use the same function for any gate you want. :P
Like this:
Code: [Select]
function MoveGate(player,gate,status)
{
   if(status="open")
   {
         obj.MoveBy(Vector(8,0,0), 2800);
   }
}


72
Script Discussion / Re: onPlayerCrouchChange is bugged ?!
« Last post by sseebbyy on October 11, 2014, 11:37:57 pm »
I noticed that onPlayerCrouchChange always returns false (probably server's bug)

I hope it will be fixed soon.



* sseebbyy is waiting for windows plugin update
I can build for you, your email?

Here is it http://www.solidfiles.com/d/fd8f42f7c2/squirrel.zip

Thank you very much, I appreciate that ! but I'm really dedicated to official plugins. :D



I finally got a license for Visual Studio. Compiled.

Good, thanks !
73
Script Discussion / Re: onPlayerCrouchChange is bugged ?!
« Last post by Gudio on October 11, 2014, 09:11:36 pm »
I finally got a license for Visual Studio. Compiled.
74
Script Discussion / Re: onPlayerCrouchChange is bugged ?!
« Last post by ysc123 on October 11, 2014, 08:25:06 pm »
* sseebbyy is waiting for windows plugin update
I can build for you, your email?

Here is it http://www.solidfiles.com/d/fd8f42f7c2/squirrel.zip
75
Script Releases / Mansion Gate
« Last post by Flockshot on October 11, 2014, 07:38:51 pm »
Today i release a simple function
What it do is add a gate ,at the entrance of Mansion,which can open and close by hotkeys.

OnPlayerStart function.
we bind the key and create the gate here.Also we will make a global variable that tell us is gate open or close.
Code: [Select]
OnServerStart()
{
open <- false;
mansiongate <- CreateObject(6000,0,Vector(-277, -495, 10),255);

opengate <- BindKey(true,0x104F ,0,0); //The Key IS "O"
closegate <- BindKey(true,0x205A,0,0); //The Key IS "Z"
}

OnKeyDown function
where we will add our function.
Code: [Select]
function onKeyDown(player, bindid)
{
if(bindid==opengate)
{
if(open==false) MoveGate(player,mansiongate.ID,"open");
else MessagePlayer("Gate is already open.",player);
}

else if(bindid==closegate)
{
if(open==true) MoveGate(player,mansiongate.ID,"close");
else MessagePlayer("Gate is already closed.",player);
}
}

MoveGate function
we will open or close the gate here.
Code: [Select]
function MoveGate(player,gate, status)
{
local obj=FindObject(gate);
if(obj)
{
if(status=="open")
{


MessagePlayer("Opening Gate",player);
obj.MoveBy(Vector(8,0,0), 2800);
open=true;
}
else if(status=="close")
{

MessagePlayer("Closing Gate",player);
obj.MoveBy(Vector(-8,0,0), 2800);
open=false;

}
}
else MessagePlayer("Object could not be found.",player);
}

This is it for this function or
If you want to only use 1 key for both opening and closing then use this.

OnPlayerStart function.
Same just we dont bind the key "Z".
Code: [Select]
OnServerStart()
{
open <- false;
mansiongate <- CreateObject(6000,0,Vector(-277, -495, 10),255);

gate <- BindKey(true,0x104F ,0,0); //The Key IS "O"
}

OnKeyDown function
we will only use one key here.
Code: [Select]
function onKeyDown(player, bindid)
{
if(bindid==gate)
{
if(open==false) MoveGate(player,masiongate.ID,"open");
else MoveGate(player,mansiongate.ID,"close");
}

}


MoveGate function
Same func
Code: [Select]
function MoveGate(player,gate, status)
{
local obj=FindObject(gate);
if(obj)
{
if(status=="open")
{


MessagePlayer("Opening Gate",player);
obj.MoveBy(Vector(8,0,0), 2800);
open=true;
}
else if(status=="close")
{

MessagePlayer("Closing Gate",player);
obj.MoveBy(Vector(-8,0,0), 2800);
open=false;

}
}
else MessagePlayer("Object could not be found.",player);
}

Screenshots:


76
Script Discussion / Re: Exporting JSON
« Last post by Honey. on October 11, 2014, 06:22:09 pm »
Thank you, Topic Locked.
77
Script Discussion / Re: onPlayerCrouchChange is bugged ?!
« Last post by sseebbyy on October 11, 2014, 05:46:16 pm »
* sseebbyy is waiting for windows plugin update
78
Script Discussion / Re: Exporting JSON
« Last post by Gudio on October 11, 2014, 04:26:20 pm »
0.3 modules will not work on 0.4. If you want unofficial module for Linux, pm me.
79
Script Discussion / Exporting JSON
« Last post by Honey. on October 11, 2014, 03:43:12 pm »
Hello,

I was trying to make a LiveMap but the module doesn't load due to a 127 Code Error.I searched the SQuirrel Manual for an alternative method to export data to JSON but I only found out that we can make tables with the JSON syntax.I wanted to ask for an alternative way to export data to a JSON File. Please Reply.
80
Script Releases / Re: Function Accessible Locs like on 0.3
« Last post by thijn on October 11, 2014, 02:08:11 pm »
Lol, did you test this?
So many inpoly calls will lagg the shit out of your server in no time.

You're indeed better off using pickups for these kinda things.
Pages: 1 ... 6 7 [8] 9 10