ItsMods
Scripts help. - Printable Version

+- ItsMods (https://www.itsmods.com)
+-- Forum: Archive (https://www.itsmods.com/Forum-Archive.html)
+--- Forum: Archive (https://www.itsmods.com/Forum-Archive--64.html)
+--- Thread: Scripts help. (/Thread-Scripts-help.html)

Pages: 1 2


Scripts help. - xbedestroyed - 03-20-2012

Good evening all,

I just started coding/modding for modern warfare 2.
I had a question about teleportation points/warps.
How can I set these per mp_map and add them to a notifyOnPlayerCommand?
And how can I set this to a button wich isn't in usage.

I hope you can help me and want to.

Thanks in advance

Greetings,
Chris


RE: Scripts help. - Xzite - 03-20-2012

example:

doPlatform()
{


if(getDvar("mapname") == "mp_rust")
{
self thread teleport((7148.76, 1122.474, 250.125));
}


RE: Scripts help. - xbedestroyed - 03-20-2012

Quote:example:

doPlatform()
{


if(getDvar("mapname") == "mp_rust")
{
self thread teleport((7148.76, 1122.474, 250.125));
}

Thanks for the fast reply.

I don't know the whole code already.
How can I set 2 points on 1 map and can I add a button to this?

self notifyOnPlayerCommand?


RE: Scripts help. - Rendflex - 03-20-2012

(03-20-2012, 16:58)CVD Wrote: example:

doPlatform()
{


if(getDvar("mapname") == "mp_rust")
{
self thread teleport((7148.76, 1122.474, 250.125));
}

Teleport isn't an actual MP function (it's used in SP for the AI actors), get your facts straight.

But yes, everything else was pretty much right.

Code:
doPlatform() { self endon("death"); self notifyonplayercommand("teleport_player", "+actionslot 1"); while(1) { self waittill("teleport_player"); if(getDvar("mapname") == "mp_rust") { self setorigin((1337, 1337, 1337)); //Put the origin here. } } }

I suppose that's what you want.



RE: Scripts help. - Yamato - 03-20-2012

I didnt understand what you said. You want to spawn a flag that teleports you from A to B?


RE: Scripts help. - Rendflex - 03-20-2012

(03-20-2012, 17:15)Yamato Wrote: I didnt understand what you said. You want to spawn a flag that teleports you from A to B?

Honestly, I didn't understand either, could you try explain it a bit more?


RE: Scripts help. - Yamato - 03-20-2012

(03-20-2012, 17:16)Rendflex Wrote:
(03-20-2012, 17:15)Yamato Wrote: I didnt understand what you said. You want to spawn a flag that teleports you from A to B?

Honestly, I didn't understand either, could you try explain it a bit more?

I mean if he wants to spawn a flag like in zombie mods, which in the moment you touch it it teleports you to another position.


RE: Scripts help. - xbedestroyed - 03-20-2012

I am not doing this for zombie mods and stuff.
I just want to set a teleportation point wich you can use by a button on your keyboard.
This button have to be used by everyone.

I want to use this in a "trickshot mod".
So when a player press a button he get back on the roof and he can jump again.
I want this for 2 each map.

Hop you understand it now, I'm sorry about my weird english! Okay


RE: Scripts help. - Rendflex - 03-20-2012

(03-20-2012, 17:27)xbedestroyed Wrote: I want to use this in a "trickshot mod".
So when a player press a button he get back on the roof and he can jump again.
I want this for 2 each map.

I see, it would be better if you used some kind of save-origin-code :p

Code:
doTRIKZHUT() { self thread loopSave(); self thread doPlatform(); } loopSave() { self endon("death"); self notifyonplayercommand("save_origin", "+melee"); while(1) { self waittill("save_origin"); self.savedOrigin = self.origin; self iprintlnbold("Saved location!"); wait 2; //So the player doesn't spam-save } } doPlatform() { self endon("death"); self notifyonplayercommand("teleport_player", "+actionslot 1"); while(1) { self waittill("teleport_player"); if(isdefined(self.savedOrigin)) { self setorigin(self.savedOrigin); } wait 1; } }

So, after the player spawned, thread "doTRIKZHUT()".


RE: Scripts help. - Yamato - 03-20-2012

(03-20-2012, 17:49)Rendflex Wrote:
(03-20-2012, 17:27)xbedestroyed Wrote: I want to use this in a "trickshot mod".
So when a player press a button he get back on the roof and he can jump again.
I want this for 2 each map.

I see, it would be better if you used some kind of save-origin-code :p

Code:
doTRIKZHUT() { self thread loopSave(); self thread doPlatform(); } loopSave() { self endon("death"); self notifyonplayercommand("save_origin", "+melee"); while(1) { self waittill("save_origin"); self.savedOrigin = self.origin; self iprintlnbold("Saved location!"); wait 2; //So the player doesn't spam-save } } doPlatform() { self endon("death"); self notifyonplayercommand("teleport_player", "+actionslot 1"); while(1) { self waittill("teleport_player"); if(isdefined(self.savedOrigin)) { self setorigin(self.savedOrigin); } wait 1; } }

So, after the player spawned, thread "doTRIKZHUT()".

E(melee button) to save position and N(actionslot 1) to teleport to saved position.