Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* A Simple Tow Car Style Made by Gaurav_Rawat
- I hope you like it
- Please rep me if you like my work :)*/
- #include <a_samp>
- #include <zcmd>
- #define COLOR_GREY 0xAFAFAFFF
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Tow Any Car Anywhere");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print(" Tow Any Car Anywhere FS by Gaurav_Rawat");
- print("----------------------------------\n");
- }
- #endif
- public OnPlayerConnect(playerid)
- {
- SendClientMessageToAll(COLOR_GREY,"This Server uses Tow Vehicle by Gaurav_Rawat");
- return 1;
- }
- CMD:tow(playerid, params[])
- {
- if (IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))) SendClientMessage(playerid, COLOR_GREY, "You are already towing a vehicle.");
- new Float:PPPX,Float:PPPY,Float:PPPZ;
- GetPlayerPos(playerid,PPPX,PPPY,PPPZ);
- new Float:VVVX,Float:VVVY,Float:VVVZ;
- new Found=0;
- new vid=0;
- while((vid<MAX_VEHICLES)&&(!Found))
- {
- vid++;
- GetVehiclePos(vid,VVVX,VVVY,VVVZ);
- if ((floatabs(PPPX-VVVX)<7.0)&&(floatabs(PPPY-VVVY)<7.0)&&(floatabs(PPPZ-VVVZ)<7.0)&&(vid!=GetPlayerVehicleID(playerid)))
- {
- Found=1;
- AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
- }
- }
- if (!Found)
- {
- SendClientMessage(playerid,COLOR_GREY,"There is no vehicle in range.");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment