SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Reply
 
Thread Tools Display Modes
Old 06/10/2013, 09:10 PM   #1
TonyII
Huge Clucker
 
Join Date: Aug 2013
Posts: 340
Reputation: 58
Default Unique controllable Pirate Ship

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 Code:
//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;
}
TonyII is offline   Reply With Quote
Old 06/10/2013, 10:19 PM   #2
ThuuGLif3
Huge Clucker
 
ThuuGLif3's Avatar
 
Join Date: Sep 2013
Posts: 470
Reputation: 18
Default Re: Unique controllable Pirate Ship

Nice ^.^
__________________

ThuuGLif3 is offline   Reply With Quote
Old 06/10/2013, 11:10 PM   #3
ThuuGLif3
Huge Clucker
 
ThuuGLif3's Avatar
 
Join Date: Sep 2013
Posts: 470
Reputation: 18
Default Re: Unique controllable Pirate Ship

@Edit.
Apertei enter sem querer ;9
__________________

ThuuGLif3 is offline   Reply With Quote
Old 08/10/2013, 05:57 PM   #4
TonyII
Huge Clucker
 
Join Date: Aug 2013
Posts: 340
Reputation: 58
Default Re: Unique controllable Pirate Ship

Thanks
TonyII is offline   Reply With Quote
Old 08/10/2013, 06:04 PM   #5
xXxGamerxXx
Banned
 
Join Date: Oct 2013
Posts: 27
Reputation: -9
Default Re: Unique controllable Pirate Ship

great! 10/10
xXxGamerxXx is offline   Reply With Quote
Old 08/10/2013, 06:10 PM   #6
RafaelZam
Huge Clucker
 
RafaelZam's Avatar
 
Join Date: Jun 2012
Location: Trust yourself.
Posts: 293
Reputation: 16
Default Respuesta: Unique controllable Pirate Ship

lol tonyII this nice !
good job !
+rep C: !
__________________
Just Tryin' to get it right
RafaelZam is offline   Reply With Quote
Old 08/10/2013, 06:56 PM   #7
TonyII
Huge Clucker
 
Join Date: Aug 2013
Posts: 340
Reputation: 58
Default Re: Unique controllable Pirate Ship

Thanks guys
TonyII is offline   Reply With Quote
Old 08/10/2013, 08:20 PM   #8
Rg-Gaming.Info
Huge Clucker
 
Rg-Gaming.Info's Avatar
 
Join Date: Jan 2012
Location: Europe
Posts: 223
Reputation: 10
Default Re: Unique controllable Pirate Ship

You've done a pretty damn good job on this one, mate. Keep it up! +rep
Rg-Gaming.Info is offline   Reply With Quote
Old 08/10/2013, 08:47 PM   #9
MBilal
Gangsta
 
MBilal's Avatar
 
Join Date: May 2013
Posts: 811
Reputation: 57
Default Re: Unique controllable Pirate Ship

Coooooooooooollllllllllllllll 10/10 dude
MBilal is offline   Reply With Quote
Old 08/10/2013, 08:51 PM   #10
CesarLT
Banned
 
Join Date: Sep 2013
Posts: 262
Reputation: 15
Default Re: Unique controllable Pirate Ship

Awsome job! Waiting to see more
CesarLT is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] Controllable Alien Ship Pottus Filterscripts 39 07/05/2015 07:44 PM
[Map] Little Island Near Pirate Ship Salsa Maps 11 05/05/2012 01:50 PM
[FS] Flying Pirate Ship l Help me please. thoml Help Archive 4 28/01/2010 04:01 PM
turn pirate ship keessie Help Archive 5 18/03/2009 02:30 PM


All times are GMT. The time now is 04:47 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.