Movable stretcher? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Movable stretcher? (
/showthread.php?tid=251859)
Movable stretcher? -
Outcast - 29.04.2011
Well, I want to script a command when you type /stretcher a stretcher spawn infront of you and when you move, it seems like you're pushing it. Well, the problem is that I don't know how to make it "follow" me. I tried attaching the object but when I walk it moves around and goes in the air and/or in the ground, so it doesn't look very realistical.
Any ideas would be appriciated.
Re: Movable stretcher? -
X3nZ - 29.04.2011
Well, you can make it act like a weapon attached to the player.
Like I've scripted (for fun) when you have a minigun and you holster it, it seems you have a minigun penis..
The minigun sticks out of the crouch area. You could maybe do that?
Re: Movable stretcher? -
Outcast - 29.04.2011
Well, I figured it out but I have another problem. When I do /dropstretcher, my character appears on top of the stretcher. Is there a way to get a position of an attached object? When I tried it, my stretchers spawned at the place I took them. How to make it that my stretchers always spawn on the right side from my character and how to make it that when a player gets removed from vehicle that he spawns at the back of the ambulance?
pawn Код:
CMD:stretcher(playerid)
{
new Float:X, Float:Y, Float:Z, Float:R;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, R);
Stretcher[playerid] = CreateObject(2146, X, Y, Z, 0, 0, R, 100.0);
AttachObjectToPlayer(Stretcher[playerid], playerid, 0.00, 1.30, -0.50, 0.0, 0.0, 0.0 );
UsingStretcher[playerid] = 1;
return 1;
}
CMD:dropstretcher(playerid)
{
new Float:X, Float:Y, Float:Z, Float:R;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, R);
DestroyObject(Stretcher[playerid]);
Stretcher[playerid] = CreateObject(2146, X, Y, Z - 0.60, 0, 0, R, 100.0);
UsingStretcher[playerid] = 0;
return 1;
}
CMD:pickupstretcher(playerid)
{
new Float:X, Float:Y, Float:Z;
GetObjectPos(Stretcher[playerid], X, Y, Z);
if(IsPlayerInRangeOfPoint(playerid, 5.0, X, Y, Z) && UsingStretcher[playerid] == 0)
{
AttachObjectToPlayer(Stretcher[playerid], playerid, 0.00, 1.30, -0.50, 0.0, 0.0, 0.0 );
UsingStretcher[playerid] = 1;
return 1;
}
else return SendClientMessage(playerid,0xFFFFFFFF,"ERROR: You are not near a stretcher or you are using it.");
}