26.06.2011, 19:59
(
Последний раз редактировалось iPLEOMAX; 03.02.2012 в 11:42.
)
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);
You can also use it this way:
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:
Lets see this in a working command (ZCMD & sscanf):
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.
--
*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. ;)
pawn Код:
new myvehicle;
myvehicle = CreateVehicleForPlayer(playerid, "NRG", -1, -1, 1000.0);
// so, you can attach stuff / tele it.. or whateva.
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.
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;
}
/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.
--