Okay, so i made a controllable vehicle cog(s)... in SP it works just fine, but when another player joins, it's messed up... it's Client/Server...
Server side cog:
Client side:
No it's not for a project, just something made because of boredom... if you find them usefull, use them... if you use them credit me...
As you know, walkstructures can't be moved with applyforce();, so i attached thing pad with thing pattach, which is invisible throwable object without collide box.
Anyway, if someone finds what's wrong, tell me... thank you...
------------------
Life is like... skating... yeah, skating is a good example. You see someone skating and think "Hey, that looks like fun and easy!". You go and buy a skateboard and try, you get a few broken bones, asphalt-face and stuff... But hey, i'm not the one who gets hurt!
Server side cog:
Code:
symbols
thing player local
int act=0 local
int padID
message startup
message activated
message pulse
message killed
end
# ========================================================================================
code
startup:
player = GetLocalPlayerThing();
SendTrigger(-1, 120 + padID, player, 0, 0, 0);
Return;
activated:
if(act == 0)
{
SendTrigger(-1, 130 + padID, player, 0, 0, 0);
SetPulse(0.05);
act = 1;
}
else
if(act == 1)
{
SetPulse(0.0);
SendTrigger(-1, 140 + padID, player, 0, 0, 0);
act = 0;
}
Return;
killed:
if(player == GetSenderRef())
{
SendTrigger(-1, 140 + padID, player, 0, 0, 0);
}
Return;
pulse:
SendTrigger(-1, 150 + padID, player, 0, 0, 0);
Return;
endClient side:
Code:
flags=0x240
symbols
thing pattach
thing pad
thing player local
template lookt=+ghost
template smoke=+twinkle
vector look local
int lookie local
vector lookv local
int act=0 local
int padID
message trigger
end
# ========================================================================================
code
trigger:
if( (GetSourceRef() == 120 + padID))
{
AttachThingToThingEx(pad, pattach, 0x8);
}
else
if( (GetSourceRef() == 130 + padID))
{
AttachThingToThingEx(GetParam(0), pattach, 0x8);
SetThingPos(GetParam(0), VectorAdd(GetThingPos(pad), '0.0 0.0 0.03'));
}
else
if( (GetSourceRef() == 140 + padID))
{
SetThingPos(GetParam(0), VectorAdd(GetThingPos(pad), '0.0 0.0 0.04'));
DetachThing(GetParam(0));
StopThing(pattach);
StopThing(GetParam(0));
}
else
if( (GetSourceRef() == 150 + padID))
{
lookie = FireProjectile(GetParam(0), lookt, -1, -1, '0.0 0.0 0.0', '0 0 0', 1, 0x20, -1, -1);
CreateThing(smoke, pattach);
lookv = GetThingLVec(GetParam(0));
SetThingLook(pad, lookv);
SetThingLook(pattach, GetThingLVec(GetParam(0)));
ApplyForce(pattach, VectorScale(GetThingLVec(lookie), 30));
DestroyThing(lookie);
}
return;
endNo it's not for a project, just something made because of boredom... if you find them usefull, use them... if you use them credit me...
As you know, walkstructures can't be moved with applyforce();, so i attached thing pad with thing pattach, which is invisible throwable object without collide box.
Anyway, if someone finds what's wrong, tell me... thank you...
------------------
Life is like... skating... yeah, skating is a good example. You see someone skating and think "Hey, that looks like fun and easy!". You go and buy a skateboard and try, you get a few broken bones, asphalt-face and stuff... But hey, i'm not the one who gets hurt!
Last edited by mb; today at 10:55 AM.

![http://forums.massassi.net/html/smile.gif [http://forums.massassi.net/html/smile.gif]](http://forums.massassi.net/html/smile.gif)
![http://forums.massassi.net/html/rolleyes.gif [http://forums.massassi.net/html/rolleyes.gif]](http://forums.massassi.net/html/rolleyes.gif)
![http://forums.massassi.net/html/wink.gif [http://forums.massassi.net/html/wink.gif]](http://forums.massassi.net/html/wink.gif)
![http://forums.massassi.net/html/biggrin.gif [http://forums.massassi.net/html/biggrin.gif]](http://forums.massassi.net/html/biggrin.gif)
![http://forums.massassi.net/html/tongue.gif [http://forums.massassi.net/html/tongue.gif]](http://forums.massassi.net/html/tongue.gif)