[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
#22

Thanks, But whenever i type /spu ingame, it says the command doesn't exsist, Any idea? Really want this one!
Reply
#23

Quote:
Originally Posted by [TD]Torben
Посмотреть сообщение
Thanks, But whenever i type /spu ingame, it says the command doesn't exsist, Any idea? Really want this one!
No idea why it would say that it doesn't exist, maybe it's something in your gamemode that blocks it?

Or you could change the command?
Reply
#24

Really nice, great effort.

Quote:
Originally Posted by SkizzoTrick
View Post
You could add some lights to the LSPD Choppers too xD
^^ Just what he said lol...
Reply
#25

C:\Users\Thimo\Desktop\Untitled.pwn(57) : error 017: undefined symbol "AttachObjectToVehicle"
C:\Users\Thimo\Desktop\Untitled.pwn(72) : error 017: undefined symbol "AttachObjectToVehicle"
C:\Users\Thimo\Desktop\Untitled.pwn(86) : error 017: undefined symbol "AttachObjectToVehicle"
C:\Users\Thimo\Desktop\Untitled.pwn(100) : error 017: undefined symbol "AttachObjectToVehicle"
C:\Users\Thimo\Desktop\Untitled.pwn(114) : error 017: undefined symbol "AttachObjectToVehicle"
C:\Users\Thimo\Desktop\Untitled.pwn(12 : error 017: undefined symbol "AttachObjectToVehicle"
C:\Users\Thimo\Desktop\Untitled.pwn(142) : error 017: undefined symbol "AttachObjectToVehicle"
C:\Users\Thimo\Desktop\Untitled.pwn(156) : error 017: undefined symbol "AttachObjectToVehicle"
C:\Users\Thimo\Desktop\Untitled.pwn(187) : error 017: undefined symbol "AttachObjectToVehicle"
C:\Users\Thimo\Desktop\Untitled.pwn(203) : error 017: undefined symbol "AttachObjectToVehicle"
C:\Users\Thimo\Desktop\Untitled.pwn(219) : error 017: undefined symbol "AttachObjectToVehicle"
C:\Users\Thimo\Desktop\Untitled.pwn(235) : error 017: undefined symbol "AttachObjectToVehicle"
C:\Users\Thimo\Desktop\Untitled.pwn(251) : error 017: undefined symbol "AttachObjectToVehicle"
C:\Users\Thimo\Desktop\Untitled.pwn(267) : error 017: undefined symbol "AttachObjectToVehicle"
C:\Users\Thimo\Desktop\Untitled.pwn(283) : error 017: undefined symbol "AttachObjectToVehicle"
C:\Users\Thimo\Desktop\Untitled.pwn(299) : error 017: undefined symbol "AttachObjectToVehicle"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

16 Errors.

HELP!? :S

EDIT: Works now
Reply
#26

Quote:
Originally Posted by thimo
Посмотреть сообщение
C:\Users\Thimo\Desktop\Untitled.pwn(57) : error 017: undefined symbol "AttachObjectToVehicle"
C:\Users\Thimo\Desktop\Untitled.pwn(72) : error 017: undefined symbol "AttachObjectToVehicle"
C:\Users\Thimo\Desktop\Untitled.pwn(86) : error 017: undefined symbol "AttachObjectToVehicle"
C:\Users\Thimo\Desktop\Untitled.pwn(100) : error 017: undefined symbol "AttachObjectToVehicle"
C:\Users\Thimo\Desktop\Untitled.pwn(114) : error 017: undefined symbol "AttachObjectToVehicle"
C:\Users\Thimo\Desktop\Untitled.pwn(12 : error 017: undefined symbol "AttachObjectToVehicle"
C:\Users\Thimo\Desktop\Untitled.pwn(142) : error 017: undefined symbol "AttachObjectToVehicle"
C:\Users\Thimo\Desktop\Untitled.pwn(156) : error 017: undefined symbol "AttachObjectToVehicle"
C:\Users\Thimo\Desktop\Untitled.pwn(187) : error 017: undefined symbol "AttachObjectToVehicle"
C:\Users\Thimo\Desktop\Untitled.pwn(203) : error 017: undefined symbol "AttachObjectToVehicle"
C:\Users\Thimo\Desktop\Untitled.pwn(219) : error 017: undefined symbol "AttachObjectToVehicle"
C:\Users\Thimo\Desktop\Untitled.pwn(235) : error 017: undefined symbol "AttachObjectToVehicle"
C:\Users\Thimo\Desktop\Untitled.pwn(251) : error 017: undefined symbol "AttachObjectToVehicle"
C:\Users\Thimo\Desktop\Untitled.pwn(267) : error 017: undefined symbol "AttachObjectToVehicle"
C:\Users\Thimo\Desktop\Untitled.pwn(283) : error 017: undefined symbol "AttachObjectToVehicle"
C:\Users\Thimo\Desktop\Untitled.pwn(299) : error 017: undefined symbol "AttachObjectToVehicle"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

16 Errors.

HELP!? :S
Download the 0.3c files for the server, https://sampforum.blast.hk/showthread.php?tid=194031
Reply
#27

Awesome Geso!!!!
SuperGT will be nice in the next versions!
Suggestion:
Make it that you can spawn 1 car at the time. That means if you spawn a 2nd car, the other car will dissapear.
Reply
#28

Can you please make it on an infernus?
Reply
#29

Wow Good job Geso
Reply
#30

it doesnt work!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)