SA-MP Forums Archive
[FilterScript] Unique controllable Pirate Ship - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Unique controllable Pirate Ship (/showthread.php?tid=468166)



Unique controllable Pirate Ship - TonyII - 06.10.2013

Hey guys, here I created the controllable ship, it's simple but very unique.
Usage is very simple aswell, you just do /commandship and you're the captain of the ship. It's very stable, you can stand on the ship, this is very useful for TDM or DM, this can bring unique idea's to such servers. Enjoy it!

Images:







Code:
pawn Код:
//Pirate Ship by TonyII

#include <a_samp>
#include <zcmd>

new PirateObject,
    PirateFence,
    PirateRopes,
    PirateShip;
new Camera;
new ControllingShip[MAX_PLAYERS];

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print("Pirate Ship by TonyII is running");
    print("--------------------------------------\n");
    PirateObject = CreateObject(8493,0,0,-100,0,0,0);
    PirateFence = CreateObject(9159,0,0,-100,0,0,0);
    PirateRopes = CreateObject(8981,0,0,-100,0,0,0);
    PirateShip = AddStaticVehicleEx(454, 723.6520, -1890.7867, -0.0164, 180.0000, -1, -1, -1);
    AttachObjectToVehicle(PirateObject, PirateShip, 0.809999, 1.439998, 16.650209, 0.000000, 0.000000, 0.000000);
    AttachObjectToVehicle(PirateRopes, PirateShip, 0.294999, -4.665059, 16.250276, 0.000000, 0.000000, 0.000000);
    AttachObjectToVehicle(PirateFence, PirateShip, 0.784999, 1.439998, 16.655208, 0.000000, 0.000000, 0.000000);
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (newkeys & KEY_SECONDARY_ATTACK)
    {
        if(ControllingShip[playerid] == 1)
        {
        ControllingShip[playerid] = 0;
        new Float:X,Float:Y,Float:Z;
        GetPlayerPos(playerid, X,Y,Z);
        SetPlayerPos(playerid, X,Y+2,Z+6);
        SetCameraBehindPlayer(playerid);
        DestroyObject(Camera);
        }
    }
    return 1;
}

CMD:commandship(playerid, params[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(ControllingShip[i] == 1) return SendClientMessage(playerid, -1,"The ship is being held in command by someone else.");
    }
    Camera = CreateObject(0, 0,0,0,0,0,0);
    AttachObjectToVehicle(Camera, PirateShip,0,-35,23,0.000000,0.000000,0.0);
    PutPlayerInVehicle(playerid, PirateShip, 0);
    AttachCameraToObject(playerid, Camera);
    ControllingShip[playerid] = 1;
    SendClientMessage(playerid, -1,"Type /quitship or press 'F' if you want to stop commanding this ship.");
    return 1;
}

CMD:quitship(playerid, params[])
{
    if(ControllingShip[playerid] == 0) return SendClientMessage(playerid, -1,"You do not command the ship.");
    ControllingShip[playerid] = 0;
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X,Y,Z);
    SetPlayerPos(playerid, X,Y+2,Z+6);
    SetCameraBehindPlayer(playerid);
    DestroyObject(Camera);
    return 1;
}



Re: Unique controllable Pirate Ship - ThuuGLif3 - 06.10.2013

Nice ^.^



Re: Unique controllable Pirate Ship - ThuuGLif3 - 06.10.2013

@Edit.
Apertei enter sem querer ;9


Re: Unique controllable Pirate Ship - TonyII - 08.10.2013

Thanks


Re: Unique controllable Pirate Ship - xXxGamerxXx - 08.10.2013

great! 10/10


Respuesta: Unique controllable Pirate Ship - RafaelZam - 08.10.2013

lol tonyII this nice !
good job !
+rep C: !


Re: Unique controllable Pirate Ship - TonyII - 08.10.2013

Thanks guys


Re: Unique controllable Pirate Ship - Rg-Gaming.Info - 08.10.2013

You've done a pretty damn good job on this one, mate. Keep it up! +rep


Re: Unique controllable Pirate Ship - MBilal - 08.10.2013

Coooooooooooollllllllllllllll 10/10 dude


Re: Unique controllable Pirate Ship - CesarLT - 08.10.2013

Awsome job! Waiting to see more