Author Topic: My scripting problems: 0  (Read 4253 times)

OH YES THANK YOU!  :cookieMonster:  :cookieMonster:  :cookieMonster:

I forgot that. And i have read it, just cant memorize all of it cos its so long. Well, thats done. Do you know how to use getsimtime() in a script?

OH YES THANK YOU!  :cookieMonster:  :cookieMonster:  :cookieMonster:

I forgot that. And i have read it, just cant memorize all of it cos its so long. Well, thats done. Do you know how to use getsimtime() in a script?
Sorry, i would like to see that answered too.
I'm also not that very experienced yet.

Though, i can answer some simple things to help people out. ;)

Thank you for all your help, i only started TS a few days ago, and i am just learning. I just made a script using the toggle to make the camera free mode/fixed mode.


OK, thats weird..... Why doesn't messageall message me?

OK, thats weird..... Why doesn't messageall message me?
It sends the message to others, but not to you?
I don't know how that could be, sorry.

No matter, i just had messagemode disabled (i made a quick script to disable messaging). And i think i worked out how to use getsimtime()...

This is how getSimTime() is used in the shotgun script to prevent players from re-equipping it to reload faster.
Code: [Select]
function shotgunImage::onFire(%this,%obj,%slot)
{
if((%obj.lastFireTime + %this.minShotTime) > getSimTime())
return;
%obj.lastFireTime = getSimTime();
...
}

Thanks, i'll be using this  :cookieMonster:.



Code: [Select]
  %toggletest = 0;
The "toggletest" variable should be a global ($toggletest) not a local (%toggletest) otherwise it's reset to "" counted as 0 whenever the function is called and it'll always turn on, never off.

messageAll has two arguments, the message type and the message text. For the message type you can just use '' for a chat message.

messageAll('', "Hello");


//exec("config/Test.cs");

function servercmdcount(%mins)

{
%mins * 1000;

while (getsimtime()<getsimtime() + %mins)

{
%mins - 1000;
centerprintAll(%mins);
}

if (getsimtime()>=getsimtime() + %mins)

{
centerprintAll(" ");
}
Also, %mins would be the player who said /count, not sure how useful that would be.