04.01.2014, 13:46
(
Последний раз редактировалось Abagail; 05.02.2014 в 22:44.
Причина: Fixed a typo in step #2.
)
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; }
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