[Include] SendVehicleToPlayer.inc
#1

SendVehicleToPlayer!
I made a simple include to Send A given vehicleid to a given playerid. It also comes with a neat little SetVehiclePosEx function which is used in the SendVehicleToPlayer stock.

Version 2:
Version 2 goes back to this include, and basically changes it up, - fixes some minor things, and also implements a "putin" feature. Basically, it can be used to put the player in the vehicle(vehid). How-ever it's still backwards compatible since it's an optional param.

This is how you can use it:

1. Put the included .inc file in your pawno - includes folder. Then advance to the next step.
2. At the top of your script, add the include by using "#include <SendVehicleToPlayer>.
3. Where you want to send the vehicle to the playerid use "SendVehicleToPlayer(vehicleid, playerid);".

An example filter-script is provided in the "Solidfiles" download(Version 2 only) Additionally, the code for this can be found below or via pastebin by clicking [URL="http://pastebin.com/bWtP1Sn4"]here");
return 1;
}

Код:
#include a_samp
#include zcmd
#include sscanf2
#include SendVehicleToPlayer2
 
CMD:sendvehtoid(playerid, params[])
{
new giveplayerid, vehid, putin, string[128];
if (sscanf(params, "ud", giveplayerid, vehid, putin)) return SendClientMessage(playerid, -1, "USAGE: /sendvehtoid [playerid] [vehid] [putin(0 - no, 1 - yes)");
if(vehid == INVALID_VEHICLE_ID) return SendClientMessage(playerid, -1, "Invalid vehicleID.");
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, -1, "Invalid Player Specified.");
if(putin == 1) return SendVehicleToPlayer(vehid, playerid, 1);
if(putin == 0) return SendVehicleToPlayer(vehid, playerid);
format(string, sizeof(string), "You have sent Vehicle ID %d to PlayerID %d.");
return 1;
}
This is my first include so please only constructive critism. But if you think it was good, you can leave a positive comment!

Links/Downloads:
Pastebin - Click Here.
Solidfiles - Click Here.
NOTE: This is an .inc file, and if you use pastebin you must save it as one.

NOTE: The Solidfiles version ONLY comes with the testing filter-script. The name of the testing filter-script is "testfs_2". This can be accessed from the "filterscripts" folder.
Pastebin(v2) - Click Here
Solidfiles(v2) - Click Here

If you find any bugs, or find a better way I could've coded this then just say so! If you like what you see share the love and leave a nice comment.

- Abagail
Reply


Messages In This Thread
SendVehicleToPlayer.inc - by Abagail - 04.01.2014, 13:46
Re: SendVehicleToPlayer.inc - by newbie scripter - 04.01.2014, 13:53
Re: SendVehicleToPlayer.inc - by fiki574 - 04.01.2014, 14:06
Re: SendVehicleToPlayer.inc - by Konstantinos - 04.01.2014, 14:20
Re: SendVehicleToPlayer.inc - by Abagail - 04.01.2014, 14:23
Re: SendVehicleToPlayer.inc - by Abagail - 04.01.2014, 14:28
Re: SendVehicleToPlayer.inc - by iZN - 04.01.2014, 17:03
Re: SendVehicleToPlayer.inc - by Abagail - 04.01.2014, 17:07
Re: SendVehicleToPlayer.inc - by newbie scripter - 05.01.2014, 04:06
Re: SendVehicleToPlayer.inc - by Abagail - 05.02.2014, 22:45

Forum Jump:


Users browsing this thread: 1 Guest(s)