[FilterScript] SPU's [Special Police Units]
#21

Quote:
Originally Posted by [TD]Torben
Посмотреть сообщение
Can someone re-upload ?
pawn Код:
#include <a_samp>

/*\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
/*\\\\\\\\\\\Script made by Geso\\\\\\\\\\\*/
/*http://forum.sa-mp.com/member.php?u=76396*/
/*\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/

#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA

new IsSpu[MAX_VEHICLES] = 0;
new Lamp[MAX_VEHICLES] = 0;
new light[MAX_VEHICLES];

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" SPU's  [Special Police Units]  by Geso ");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/spu", cmdtext, true, 10) == 0)
    {
        ShowPlayerDialog(playerid, 112, DIALOG_STYLE_LIST, "So you want to have a SPU, what one do you want then?", "Sultan [dashboard]\nSultan [roof]\nCheetah [dashboard]\nCheetah [roof]\nWashington [dashboard]\nWashington [roof]\nPremier [dashboard]\nPremier [roof]", "Take it", "Leave it" );
        return 1;
    }
    return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(response == 1 && dialogid == 112)
    {
        switch(listitem)
        {
        // We'll use the switch/cases now because we're going to process a few results, not just one. Remember, the first item in the list has id 0.
            case 0:
            {//sultan lamp inside
                new Float:x, Float:y, Float:z, Float:angle;
                GetPlayerPos(playerid, x, y, z);
                GetPlayerFacingAngle(playerid, angle);
                new vehicleid=CreateVehicle(560, x, y, z, angle, 0, 0, -1);
                PutPlayerInVehicle(playerid, vehicleid, 0);
                SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
                LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
                IsSpu[vehicleid] = 1;
                Lamp[vehicleid] = 1;
                light[vehicleid] = CreateObject(18646,x, y, z, 0.0, 0.0, 96.0);
                AttachObjectToVehicle(light[vehicleid], vehicleid, 0.398071289, 0.75390625, 0.43879509, 0.0, 0.0, 0.0);

            }
            case 1:
            {//sultan lamp outside
                new Float:x, Float:y, Float:z, Float:angle;
                GetPlayerPos(playerid, x, y, z);
                GetPlayerFacingAngle(playerid, angle);
                new vehicleid=CreateVehicle(560, x, y, z, angle, 0, 0, -1);
                PutPlayerInVehicle(playerid, vehicleid, 0);
                SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
                LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
                IsSpu[vehicleid] = 2;
                Lamp[vehicleid] = 1;
                light[vehicleid] = CreateObject(18646,x, y, z, 0.0, 0.0, 96.0);
                AttachObjectToVehicle(light[vehicleid], vehicleid, -0.35644531250, 0.0388183593, 0.863788605, 0.0, 0.0, 0.0);
            }
            case 2:
            {//cheetah lamp inside
                new Float:x, Float:y, Float:z, Float:angle;
                GetPlayerPos(playerid, x, y, z);
                GetPlayerFacingAngle(playerid, angle);
                new vehicleid=CreateVehicle(415, x, y, z, angle, 0, 0, -1);
                PutPlayerInVehicle(playerid, vehicleid, 0);
                SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
                LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
                IsSpu[vehicleid] = 3;
                Lamp[vehicleid] = 1;
                light[vehicleid] = CreateObject(18646,x, y, z, 0.0, 0.0, 96.0);
                AttachObjectToVehicle(light[vehicleid], vehicleid, 0.409729004, 0.526367188, 0.206963539, 0.0, 0.0, 0.0);
            }
            case 3:
            {//cheetah lamp outside
                new Float:x, Float:y, Float:z, Float:angle;
                GetPlayerPos(playerid, x, y, z);
                GetPlayerFacingAngle(playerid, angle);
                new vehicleid=CreateVehicle(415, x, y, z, angle, 0, 0, -1);
                PutPlayerInVehicle(playerid, vehicleid, 0);
                SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
                LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
                IsSpu[vehicleid] = 4;
                Lamp[vehicleid] = 1;
                light[vehicleid] = CreateObject(18646,x, y, z, 0.0, 0.0, 96.0);
                AttachObjectToVehicle(light[vehicleid], vehicleid, -0.290039062, -0.284179688, 0.631957054, 0.0, 0.0, 0.0);
            }
            case 4:
            {//wash lamp inside
                new Float:x, Float:y, Float:z, Float:angle;
                GetPlayerPos(playerid, x, y, z);
                GetPlayerFacingAngle(playerid, angle);
                new vehicleid=CreateVehicle(421, x, y, z, angle, 0, 0, -1);
                PutPlayerInVehicle(playerid, vehicleid, 0);
                SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
                LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
                IsSpu[vehicleid] = 5;
                Lamp[vehicleid] = 1;
                light[vehicleid] = CreateObject(18646,x, y, z, 0.0, 0.0, 96.0);
                AttachObjectToVehicle(light[vehicleid], vehicleid, 0.421691895, 0.804931641, 0.256482124, 0.0, 0.0, 0.0);
            }
            case 5:
            {//wash lamp outside
                new Float:x, Float:y, Float:z, Float:angle;
                GetPlayerPos(playerid, x, y, z);
                GetPlayerFacingAngle(playerid, angle);
                new vehicleid=CreateVehicle(421, x, y, z, angle, 0, 0, -1);
                PutPlayerInVehicle(playerid, vehicleid, 0);
                SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
                LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
                IsSpu[vehicleid] = 6;
                Lamp[vehicleid] = 1;
                light[vehicleid] = CreateObject(18646,x, y, z, 0.0, 0.0, 96.0);
                AttachObjectToVehicle(light[vehicleid], vehicleid, -0.323303223, 0.0207519532, 0.731482506, 0.0, 0.0, 0.0);
            }//done
            case 6:
            {//premier lamp inside
                new Float:x, Float:y, Float:z, Float:angle;
                GetPlayerPos(playerid, x, y, z);
                GetPlayerFacingAngle(playerid, angle);
                new vehicleid=CreateVehicle(426, x, y, z, angle, 0, 0, -1);
                PutPlayerInVehicle(playerid, vehicleid, 0);
                SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
                LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
                IsSpu[vehicleid] = 7;
                Lamp[vehicleid] = 1;
                light[vehicleid] = CreateObject(18646,x, y, z, 0.0, 0.0, 96.0);
                AttachObjectToVehicle(light[vehicleid], vehicleid, 0.575378418, 0.786132812, 0.361483574, 0.0, 0.0, 0.0);
            }
            case 7:
            {//premier lamp outside
                new Float:x, Float:y, Float:z, Float:angle;
                GetPlayerPos(playerid, x, y, z);
                GetPlayerFacingAngle(playerid, angle);
                new vehicleid=CreateVehicle(426, x, y, z, angle, 0, 0, -1);
                PutPlayerInVehicle(playerid, vehicleid, 0);
                SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
                LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
                IsSpu[vehicleid] = 8;
                Lamp[vehicleid] = 1;
                light[vehicleid] = CreateObject(18646,x, y, z, 0.0, 0.0, 96.0);
                AttachObjectToVehicle(light[vehicleid], vehicleid, -0.455505371, -0.143066406, 0.861475945, 0.0, 0.0, 0.0);
            }
        }
    }
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if((newkeys & KEY_SUBMISSION) && !(oldkeys & KEY_SUBMISSION))
    {
         VehicleLightSwitch(playerid);
    }
    return 1;
}

VehicleLightSwitch(playerid)
{
        new vid = GetPlayerVehicleID(playerid);
        if(vid == INVALID_VEHICLE_ID) return 1;
        if(IsSpu[vid] == 1)
        {
            if(Lamp[vid] == 1)
            {
                 DestroyObject(light[vid]);
                 Lamp[vid] = 0;
                 return 1;
            }
            if(Lamp[vid] == 0)
            {
                 light[vid] = CreateObject(18646,0, 0, 0, 0.0, 0.0, 96.0);
                 AttachObjectToVehicle(light[vid], vid, 0.398071289, 0.75390625, 0.43879509, 0.0, 0.0, 0.0);
                 Lamp[vid] = 1;
                 return 1;
            }
        }
        if(IsSpu[vid] == 2)
        {
            if(Lamp[vid] == 1)
            {
                 DestroyObject(light[vid]);
                 Lamp[vid] = 0;
                 return 1;
            }
            if(Lamp[vid] == 0)
            {
                 light[vid] = CreateObject(18646,0, 0, 0, 0.0, 0.0, 96.0);
                 AttachObjectToVehicle(light[vid], vid, -0.35644531250, 0.0388183593, 0.863788605, 0.0, 0.0, 0.0);
                 Lamp[vid] = 1;
                 return 1;
            }
        }
        if(IsSpu[vid] == 3)
        {
            if(Lamp[vid] == 1)
            {
                 DestroyObject(light[vid]);
                 Lamp[vid] = 0;
                 return 1;
            }
            if(Lamp[vid] == 0)
            {
                 light[vid] = CreateObject(18646,0, 0, 0, 0.0, 0.0, 96.0);
                 AttachObjectToVehicle(light[vid], vid, 0.409729004, 0.526367188, 0.206963539, 0.0, 0.0, 0.0);
                 Lamp[vid] = 1;
                 return 1;
            }
        }
        if(IsSpu[vid] == 4)
        {
            if(Lamp[vid] == 1)
            {
                 DestroyObject(light[vid]);
                 Lamp[vid] = 0;
                 return 1;
            }
            if(Lamp[vid] == 0)
            {
                 light[vid] = CreateObject(18646,0, 0, 0, 0.0, 0.0, 96.0);
                 AttachObjectToVehicle(light[vid], vid, -0.290039062, -0.284179688, 0.631957054, 0.0, 0.0, 0.0);
                 Lamp[vid] = 1;
                 return 1;
            }
        }
        if(IsSpu[vid] == 5)
        {
            if(Lamp[vid] == 1)
            {
                 DestroyObject(light[vid]);
                 Lamp[vid] = 0;
                 return 1;
            }
            if(Lamp[vid] == 0)
            {
                 light[vid] = CreateObject(18646,0, 0, 0, 0.0, 0.0, 96.0);
                 AttachObjectToVehicle(light[vid], vid, 0.421691895, 0.804931641, 0.256482124, 0.0, 0.0, 0.0);
                 Lamp[vid] = 1;
                 return 1;
            }
        }
        if(IsSpu[vid] == 6)
        {
            if(Lamp[vid] == 1)
            {
                 DestroyObject(light[vid]);
                 Lamp[vid] = 0;
                 return 1;
            }
            if(Lamp[vid] == 0)
            {
                 light[vid] = CreateObject(18646,0, 0, 0, 0.0, 0.0, 96.0);
                 AttachObjectToVehicle(light[vid], vid, -0.323303223, 0.0207519532, 0.731482506, 0.0, 0.0, 0.0);
                 Lamp[vid] = 1;
                 return 1;
            }
        }
        if(IsSpu[vid] == 7)
        {
            if(Lamp[vid] == 1)
            {
                 DestroyObject(light[vid]);
                 Lamp[vid] = 0;
                 return 1;
            }
            if(Lamp[vid] == 0)
            {
                 light[vid] = CreateObject(18646,0, 0, 0, 0.0, 0.0, 96.0);
                 AttachObjectToVehicle(light[vid], vid, 0.575378418, 0.786132812, 0.361483574, 0.0, 0.0, 0.0);
                 Lamp[vid] = 1;
                 return 1;
            }
        }
        if(IsSpu[vid] == 8)
        {
            if(Lamp[vid] == 1)
            {
                 DestroyObject(light[vid]);
                 Lamp[vid] = 0;
                 return 1;
            }
            if(Lamp[vid] == 0)
            {
                 light[vid] = CreateObject(18646,0, 0, 0, 0.0, 0.0, 96.0);
                 AttachObjectToVehicle(light[vid], vid, -0.455505371, -0.143066406, 0.861475945, 0.0, 0.0, 0.0);
                 Lamp[vid] = 1;
                 return 1;
            }
        }
        return 1;
}

Here it is.
Reply


Messages In This Thread
SPU's [Special Police Units] [v4.0] [0.3c] - by Geso - 18.12.2010, 09:02
Re: SPU's [Special Police Units] - by SkizzoTrick - 18.12.2010, 09:04
Re: SPU's [Special Police Units] - by MestreKiller - 18.12.2010, 09:05
Re: SPU's [Special Police Units] - by Geso - 18.12.2010, 09:08
Re: SPU's [Special Police Units] - by SkizzoTrick - 18.12.2010, 09:09
Re: SPU's [Special Police Units] - by Geso - 18.12.2010, 09:12
Re: SPU's [Special Police Units] - by GaGlets(R) - 18.12.2010, 09:15
Re: SPU's [Special Police Units] - by SkizzoTrick - 18.12.2010, 09:15
Re: SPU's [Special Police Units] - by nielsbon1 - 18.12.2010, 09:28
Re: SPU's [Special Police Units] - by Geso - 18.12.2010, 09:28
Re: SPU's [Special Police Units] - by nielsbon1 - 18.12.2010, 09:30
Re: SPU's [Special Police Units] - by Geso - 18.12.2010, 09:32
Re: SPU's [Special Police Units] - by rooney12 - 18.12.2010, 09:40
Re: SPU's [Special Police Units] - by Kuruskt - 18.12.2010, 09:45
Re: SPU's [Special Police Units] - by Geso - 18.12.2010, 09:47
Re: SPU's [Special Police Units] - by Zh3r0 - 18.12.2010, 09:49
Re: SPU's [Special Police Units] - by MestreKiller - 18.12.2010, 09:53
Re: SPU's [Special Police Units] - by Geso - 18.12.2010, 09:53
Re: SPU's [Special Police Units] - by Geso - 18.12.2010, 09:54
Re: SPU's [Special Police Units] - by [TD]Torben - 18.12.2010, 11:53
Re: SPU's [Special Police Units] - by Geso - 18.12.2010, 11:58
Re: SPU's [Special Police Units] - by [TD]Torben - 18.12.2010, 12:10
Re: SPU's [Special Police Units] - by Geso - 18.12.2010, 12:15
Re: SPU's [Special Police Units] - by Lorenc_ - 18.12.2010, 21:04
Re: SPU's [Special Police Units] - by thimo - 20.12.2010, 10:17
Re: SPU's [Special Police Units] - by Geso - 20.12.2010, 10:28
Re: SPU's [Special Police Units] - by Mariooo - 19.01.2011, 11:18
Re: SPU's [Special Police Units] - by ugledalen - 10.04.2011, 08:37
Re: SPU's [Special Police Units] - by oNe_87 - 16.04.2011, 07:45
AW: SPU's [Special Police Units] - by FreshDiddi - 20.04.2011, 20:55

Forum Jump:


Users browsing this thread: 1 Guest(s)