[Include] CreateVehicleForPlayer - Use Names to create vehicles, Easily.
#1

CreateVehicleForPlayer V2.1!

*This is my first include, I was a newbie in pawn back then.

You can use this include to add a new vehicle spawning function.

How it works:

#include <pvehicle>
CreateVehicleForPlayer(playerid, vehiclename[], color1, color2, Float:Health);

pawn Код:
CreateVehicleForPlayer(playerid, "NRG", -1,-1, 1000);
//This will create an NRG bike near the player and automatically put him in
//according to the player's virtual world, interior etc.

//Other examples:
CreateVehicleForPlayer(playerid, "520", -1,-1, 1000);
//As you can see here we put an integer but in the format of a string
//But this will tell the code to spawn a vehicle with id 520, which is a Hydra.

CreateVehicleForPlayer(playerid, "900", -1, -1, 1000);
//It will not create a vehicle with model id 900 cause it doesn't exist.
//Instead it will spawn an FCR-900 for you. ;)
You can also use it this way:
pawn Код:
new myvehicle;
myvehicle = CreateVehicleForPlayer(playerid, "NRG", -1, -1, 1000.0);

// so, you can attach stuff / tele it.. or whateva.
So, we can use names & ids both and easily create vehicles for
a certain player without a lot of other codes.


To delete the PLAYER's Vehicle:
pawn Код:
DeletePlayerVehicle(playerid); //This will ONLY DELETE the vehicle spawned by THIS include!
//And If it is server vehicle, it will respawn it.
Lets see this in a working command (ZCMD & sscanf):
pawn Код:
CMD:car(playerid, params[])
{
    new vname[20];
    if(!sscanf(params,"s[20]",vname))
    {
        if(!IsPlayerInAnyVehicle(playerid))
        {
            CreateVehicleForPlayer(playerid, vname, -1, -1, 1000.0);
        } else SendClientMessage(playerid, COLOR_RED, "You already have a vehicle.");
    } else SendClientMessage(playerid, COLOR_RED, "Usage: /car [vehicle name]");
    return true;
}
If I use /car turi, it will create a turismo for me.
/car 400, it will create landstalker.
/car bullet, it will create bullet.

SIMPLE!

Now, the download?
Here: Pastebin - Version 2.1
MediaFire - Version 2.1


Place "pvehicle.inc" in pawno/include/ folder.. then add #include <pvehicle> to your script.

If you like my work, Help me to help a community: AlertPay E-Mail: morshidul@hotmail.com
AlertPay Link

-Thanks to Toribio for his include, because i learnt few things from there.

--
Reply


Messages In This Thread
CreateVehicleForPlayer - Use Names to create vehicles, Easily. - by iPLEOMAX - 26.06.2011, 19:59
Re: CreateVehicleForPlayer - Use Names to create vehicles, Easily. - by FireCat - 26.06.2011, 21:52
Re: CreateVehicleForPlayer - Use Names to create vehicles, Easily. - by Markx - 26.06.2011, 22:28
Re: CreateVehicleForPlayer - Use Names to create vehicles, Easily. - by RyDeR` - 26.06.2011, 22:31
Re: CreateVehicleForPlayer - Use Names to create vehicles, Easily. - by iPLEOMAX - 26.06.2011, 22:37
Re : CreateVehicleForPlayer - Use Names to create vehicles, Easily. - by ludesert - 29.06.2011, 14:08
Re: CreateVehicleForPlayer - Use Names to create vehicles, Easily. - by juraska - 29.06.2011, 14:10
Re: CreateVehicleForPlayer - Use Names to create vehicles, Easily. - by sasuga - 29.06.2011, 14:49
Re: CreateVehicleForPlayer - Use Names to create vehicles, Easily. - by Genious - 29.06.2011, 15:03
Re: CreateVehicleForPlayer - Use Names to create vehicles, Easily. - by yuri29971102 - 01.07.2011, 14:00
Re: CreateVehicleForPlayer - Use Names to create vehicles, Easily. - by marwan - 01.07.2011, 14:23
Re: CreateVehicleForPlayer - Use Names to create vehicles, Easily. - by iPLEOMAX - 01.07.2011, 14:27
Re: CreateVehicleForPlayer - Use Names to create vehicles, Easily. - by Horrible - 15.07.2011, 08:40
Re: CreateVehicleForPlayer - Use Names to create vehicles, Easily. - by Horrible - 28.07.2011, 23:59
AW: CreateVehicleForPlayer - Use Names to create vehicles, Easily. - by Tigerkiller - 29.07.2011, 00:39
Re: CreateVehicleForPlayer - Use Names to create vehicles, Easily. - by Zh3r0 - 29.07.2011, 00:47
Re: CreateVehicleForPlayer - Use Names to create vehicles, Easily. - by iPLEOMAX - 29.07.2011, 11:10
AW: CreateVehicleForPlayer - Use Names to create vehicles, Easily. - by Pablo Borsellino - 29.07.2011, 11:29
Re: AW: CreateVehicleForPlayer - Use Names to create vehicles, Easily. - by iPLEOMAX - 29.07.2011, 11:34
Re: CreateVehicleForPlayer - Use Names to create vehicles, Easily. - by Killer786 - 12.10.2011, 14:38
Re : CreateVehicleForPlayer - Use Names to create vehicles, Easily. - by TheBest6 - 12.10.2011, 15:51
Re: CreateVehicleForPlayer - Use Names to create vehicles, Easily. - by Emmet_ - 12.10.2011, 15:57
Re: CreateVehicleForPlayer - Use Names to create vehicles, Easily. - by JaTochNietDan - 12.10.2011, 19:45
Re: CreateVehicleForPlayer - Use Names to create vehicles, Easily. - by iPLEOMAX - 12.10.2011, 19:48
Re: CreateVehicleForPlayer - Use Names to create vehicles, Easily. - by THE_KING$5$ - 15.10.2011, 11:22
Re: CreateVehicleForPlayer - Use Names to create vehicles, Easily. - by THE_KING$5$ - 15.10.2011, 11:25
Re: CreateVehicleForPlayer - Use Names to create vehicles, Easily. - by gamer931215 - 15.10.2011, 11:25
Re: CreateVehicleForPlayer - Use Names to create vehicles, Easily. - by manchestera - 20.11.2011, 17:26
Respuesta: CreateVehicleForPlayer - Use Names to create vehicles, Easily. - by [Nikk] - 26.12.2011, 22:25
Re: CreateVehicleForPlayer - Use Names to create vehicles, Easily. - by [xT]Emaratii - 28.06.2012, 10:59

Forum Jump:


Users browsing this thread: 2 Guest(s)