SA-MP Forums Archive
[FilterScript] Car spawner (Simple) Beta 0.2 - 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] Car spawner (Simple) Beta 0.2 (/showthread.php?tid=178258)



Car spawner (Simple) Beta 0.3 - Basicz - 21.09.2010

Hello all, I'm releasing my first filterscript.
It's still in beta, I will add more cars at the next version.
If you want to try it, copy the script below:

pawn Код:
// Beta 0.2
#include <a_samp>
#define Dialog 4670

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Car Spawner Coded by Basicz - Loaded ");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    print("\n----------------------------------");
    print(" Car Spawner Coded by Basicz - Unloaded ");
    print("----------------------------------\n");
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp(cmdtext, "/Carspawner", true))
    {
        ShowPlayerDialog(playerid, Dialog, DIALOG_STYLE_LIST, "Car spawner", "Infernus\nTurismo\nPhoenix\nCheetah\nBanshee\nEuros\nBuffalo\nKart\nHotknife", "Spawn", "Cancel");
        return 1;
    }
    return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == Dialog)
    {
        switch(listitem)
        {
            case 0:
                {
                    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
                    Int = GetPlayerInterior(playerid);
                    GetPlayerPos(playerid, X, Y, Z);
                    GetPlayerFacingAngle(playerid, Ang);
                    GetPlayerInterior(playerid);
                    pVeh = CreateVehicle(411, X, Y, Z, Ang, 0, 0, -1);
                    LinkVehicleToInterior(pVeh, Int);
                    PutPlayerInVehicle(playerid, pVeh, 0);
                }
            case 1:
                {
                    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
                    Int = GetPlayerInterior(playerid);
                    GetPlayerPos(playerid, X, Y, Z);
                    GetPlayerFacingAngle(playerid, Ang);
                    pVeh = CreateVehicle(451, X, Y, Z, Ang, 0, 0, -1);
                    LinkVehicleToInterior(pVeh, Int);
                    PutPlayerInVehicle(playerid, pVeh, 0);
                }
            case 2:
                {
                    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
                    Int = GetPlayerInterior(playerid);
                    GetPlayerPos(playerid, X, Y, Z);
                    GetPlayerFacingAngle(playerid, Ang);
                    pVeh = CreateVehicle(603, X, Y, Z, Ang, 0, 0, -1);
                    LinkVehicleToInterior(pVeh, Int);
                    PutPlayerInVehicle(playerid, pVeh, 0);
                }
            case 3:
                {
                    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
                    Int = GetPlayerInterior(playerid);
                    GetPlayerPos(playerid, X, Y, Z);
                    GetPlayerFacingAngle(playerid, Ang);
                    pVeh = CreateVehicle(415, X, Y, Z, Ang, 0, 0, -1);
                    LinkVehicleToInterior(pVeh, Int);
                    PutPlayerInVehicle(playerid, pVeh, 0);
                }
            case 4:
                {
                    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
                    Int = GetPlayerInterior(playerid);
                    GetPlayerPos(playerid, X, Y, Z);
                    GetPlayerFacingAngle(playerid, Ang);
                    pVeh = CreateVehicle(429, X, Y, Z, Ang, 0, 0, -1);
                    LinkVehicleToInterior(pVeh, Int);
                    PutPlayerInVehicle(playerid, pVeh, 0);
                }
            case 5:
                {
                    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
                    Int = GetPlayerInterior(playerid);
                    GetPlayerPos(playerid, X, Y, Z);
                    GetPlayerFacingAngle(playerid, Ang);
                    pVeh = CreateVehicle(587, X, Y, Z, Ang, 0, 0, -1);
                    LinkVehicleToInterior(pVeh, Int);
                    PutPlayerInVehicle(playerid, pVeh, 0);
                }
            case 6:
                {
                    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
                    Int = GetPlayerInterior(playerid);
                    GetPlayerPos(playerid, X, Y, Z);
                    GetPlayerFacingAngle(playerid, Ang);
                    pVeh = CreateVehicle(402, X, Y, Z, Ang, 0, 0, -1);
                    LinkVehicleToInterior(pVeh, Int);
                    PutPlayerInVehicle(playerid, pVeh, 0);
                }
            case 7:
                {
                    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
                    Int = GetPlayerInterior(playerid);
                    GetPlayerPos(playerid, X, Y, Z);
                    GetPlayerFacingAngle(playerid, Ang);
                    pVeh = CreateVehicle(571, X, Y, Z, Ang, 0, 0, -1);
                    LinkVehicleToInterior(pVeh, Int);
                    PutPlayerInVehicle(playerid, pVeh, 0);
                }
            case 8:
                {
                    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
                    Int = GetPlayerInterior(playerid);
                    GetPlayerPos(playerid, X, Y, Z);
                    GetPlayerFacingAngle(playerid, Ang);
                    pVeh = CreateVehicle(434, X, Y, Z, Ang, 0, 0, -1);
                    LinkVehicleToInterior(pVeh, Int);
                    PutPlayerInVehicle(playerid, pVeh, 0);
                }
        }
    }
    return 1;
}
pawn Код:
// Beta 0.3
#include <a_samp>
#define Dialog 4670

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Car Spawner Coded by Basicz - Loaded ");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    print("\n----------------------------------");
    print(" Car Spawner Coded by Basicz - Unloaded ");
    print("----------------------------------\n");
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp(cmdtext, "/Carspawner", true))
    {
        ShowPlayerDialog(playerid, Dialog, DIALOG_STYLE_LIST, "Car spawner", "Infernus\nTurismo\nPhoenix\nCheetah\nBanshee\nEuros\nBuffalo\nKart\nHotknife\nHustler\nComet\nStallion\nSunrise\nSandking", "Spawn", "Cancel");
        return 1;
    }
    return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == Dialog)
    {
        switch(listitem)
        {
            case 0:
                {
                    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
                    Int = GetPlayerInterior(playerid);
                    GetPlayerPos(playerid, X, Y, Z);
                    GetPlayerFacingAngle(playerid, Ang);
                    GetPlayerInterior(playerid);
                    pVeh = CreateVehicle(411, X, Y, Z, Ang, 0, 0, -1);
                    LinkVehicleToInterior(pVeh, Int);
                    PutPlayerInVehicle(playerid, pVeh, 0);
                }
            case 1:
                {
                    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
                    Int = GetPlayerInterior(playerid);
                    GetPlayerPos(playerid, X, Y, Z);
                    GetPlayerFacingAngle(playerid, Ang);
                    pVeh = CreateVehicle(451, X, Y, Z, Ang, 0, 0, -1);
                    LinkVehicleToInterior(pVeh, Int);
                    PutPlayerInVehicle(playerid, pVeh, 0);
                }
            case 2:
                {
                    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
                    Int = GetPlayerInterior(playerid);
                    GetPlayerPos(playerid, X, Y, Z);
                    GetPlayerFacingAngle(playerid, Ang);
                    pVeh = CreateVehicle(603, X, Y, Z, Ang, 0, 0, -1);
                    LinkVehicleToInterior(pVeh, Int);
                    PutPlayerInVehicle(playerid, pVeh, 0);
                }
            case 3:
                {
                    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
                    Int = GetPlayerInterior(playerid);
                    GetPlayerPos(playerid, X, Y, Z);
                    GetPlayerFacingAngle(playerid, Ang);
                    pVeh = CreateVehicle(415, X, Y, Z, Ang, 0, 0, -1);
                    LinkVehicleToInterior(pVeh, Int);
                    PutPlayerInVehicle(playerid, pVeh, 0);
                }
            case 4:
                {
                    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
                    Int = GetPlayerInterior(playerid);
                    GetPlayerPos(playerid, X, Y, Z);
                    GetPlayerFacingAngle(playerid, Ang);
                    pVeh = CreateVehicle(429, X, Y, Z, Ang, 0, 0, -1);
                    LinkVehicleToInterior(pVeh, Int);
                    PutPlayerInVehicle(playerid, pVeh, 0);
                }
            case 5:
                {
                    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
                    Int = GetPlayerInterior(playerid);
                    GetPlayerPos(playerid, X, Y, Z);
                    GetPlayerFacingAngle(playerid, Ang);
                    pVeh = CreateVehicle(587, X, Y, Z, Ang, 0, 0, -1);
                    LinkVehicleToInterior(pVeh, Int);
                    PutPlayerInVehicle(playerid, pVeh, 0);
                }
            case 6:
                {
                    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
                    Int = GetPlayerInterior(playerid);
                    GetPlayerPos(playerid, X, Y, Z);
                    GetPlayerFacingAngle(playerid, Ang);
                    pVeh = CreateVehicle(402, X, Y, Z, Ang, 0, 0, -1);
                    LinkVehicleToInterior(pVeh, Int);
                    PutPlayerInVehicle(playerid, pVeh, 0);
                }
            case 7:
                {
                    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
                    Int = GetPlayerInterior(playerid);
                    GetPlayerPos(playerid, X, Y, Z);
                    GetPlayerFacingAngle(playerid, Ang);
                    pVeh = CreateVehicle(571, X, Y, Z, Ang, 0, 0, -1);
                    LinkVehicleToInterior(pVeh, Int);
                    PutPlayerInVehicle(playerid, pVeh, 0);
                }
            case 8:
                {
                    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
                    Int = GetPlayerInterior(playerid);
                    GetPlayerPos(playerid, X, Y, Z);
                    GetPlayerFacingAngle(playerid, Ang);
                    pVeh = CreateVehicle(434, X, Y, Z, Ang, 0, 0, -1);
                    LinkVehicleToInterior(pVeh, Int);
                    PutPlayerInVehicle(playerid, pVeh, 0);
                }
            case 9:
                {
                    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
                    Int = GetPlayerInterior(playerid);
                    GetPlayerPos(playerid, X, Y, Z);
                    GetPlayerFacingAngle(playerid, Ang);
                    pVeh = CreateVehicle(545, X, Y, Z, Ang, 0, 0, -1);
                    LinkVehicleToInterior(pVeh, Int);
                    PutPlayerInVehicle(playerid, pVeh, 0);
                }
            case 10:
                {
                    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
                    Int = GetPlayerInterior(playerid);
                    GetPlayerPos(playerid, X, Y, Z);
                    GetPlayerFacingAngle(playerid, Ang);
                    pVeh = CreateVehicle(480, X, Y, Z, Ang, 0, 0, -1);
                    LinkVehicleToInterior(pVeh, Int);
                    PutPlayerInVehicle(playerid, pVeh, 0);
                }
            case 11:
                {
                    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
                    Int = GetPlayerInterior(playerid);
                    GetPlayerPos(playerid, X, Y, Z);
                    GetPlayerFacingAngle(playerid, Ang);
                    pVeh = CreateVehicle(439, X, Y, Z, Ang, 0, 0, -1);
                    LinkVehicleToInterior(pVeh, Int);
                    PutPlayerInVehicle(playerid, pVeh, 0);
                }
            case 12:
                {
                    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
                    Int = GetPlayerInterior(playerid);
                    GetPlayerPos(playerid, X, Y, Z);
                    GetPlayerFacingAngle(playerid, Ang);
                    pVeh = CreateVehicle(550, X, Y, Z, Ang, 0, 0, -1);
                    LinkVehicleToInterior(pVeh, Int);
                    PutPlayerInVehicle(playerid, pVeh, 0);
                }
            case 13:
                {
                    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
                    Int = GetPlayerInterior(playerid);
                    GetPlayerPos(playerid, X, Y, Z);
                    GetPlayerFacingAngle(playerid, Ang);
                    pVeh = CreateVehicle(495, X, Y, Z, Ang, 0, 0, -1);
                    LinkVehicleToInterior(pVeh, Int);
                    PutPlayerInVehicle(playerid, pVeh, 0);
                }
        }
    }
    return 1;
}
Commands:
/Carspawner - Show the player a dialog to spawn a car.
--------------

Have fun!

Info: The filterscript has been updated to version beta 0.3


Re: Car spawner (Simple) Beta 0.2 - royal_king - 21.09.2010

nice one mate


Re: Car spawner (Simple) Beta 0.2 - Basicz - 21.09.2010

Quote:
Originally Posted by royal_king[xXx]
Посмотреть сообщение
nice one mate
Thanks for the comment!
Now i will add more cars.


Re: Car spawner (Simple) Beta 0.2 - speedruntrainer - 21.09.2010

Awesome, nice job


Re: Car spawner (Simple) Beta 0.2 - Basicz - 21.09.2010

Thanks!


Re: Car spawner (Simple) Beta 0.2 - Kitten - 22.09.2010

really nice script


Re: Car spawner (Simple) Beta 0.2 - Basicz - 22.09.2010

Quote:
Originally Posted by Kitten
Посмотреть сообщение
really nice script
Thanks!


Re: Car spawner (Simple) Beta 0.2 - theparadox - 24.09.2010

i like this


Re: Car spawner (Simple) Beta 0.2 - i514x - 04.10.2010

Basicz, maybe you would want to make a loop that automaticly adds all the vehicles's names etc.


Re: Car spawner (Simple) Beta 0.2 - Medo - 12.11.2010

Pal why didnt you just make a /veh command using tmp so if you write an car id it spawns it?
That would be much usefull but good job.