Author Topic: Moving Bridge and HD Roads Texture Mods  (Read 2079 times)

Offline GodFatherDenzell

  • Sr. Member
  • ****
  • Posts: 407
  • cookies: 23
  • The GodMother
  • IG name: Pepe_The_Frog
Moving Bridge and HD Roads Texture Mods
« on: June 27, 2016, 01:25 »
Does someone know what method used in making the bridges move downside when a player is near? Please give me some hints not the exact code. I am now scripting my map :D thanks

second, is there an easy way to install HD roads mod? or do i really need to replace the texture 1 by 1 using img tool in gta3.img? if there is, can someone please post it's link here :D thanks

P.S. i tried some algorithms but that's not the actually i need and i want...

LAST SEEN
TOTAL TIME ON SERVER
SCORE
TRUCK LOADS
CONVOY SCORE
ACHIEVEMENTS
ARTIC
DUMPER
VAN
FUEL
CEMENT
ARRESTS
CARS STOLEN
COACH
PLANE
HELICOPTER
TOW TRUCK
LIMO
TRASH
ARMORED VAN
BURGLARIES
ARMORED VANS STOLEN
MISSIONS FAILED
OVERLOADED
FINES PAID
TOTAL SPENT ON FUEL
INTEREST EARNED
DISTANCE TRAVELLED
TIME IN JAIL
LAST MISSION
Generated by ASP.NET Core on Linux using the Convoy Trucking API. Updates every 5 minutes. See the original SVG image.

Offline Ethan

  • VIP
  • Hero Member
  • *****
  • Posts: 15,850
  • cookies: 229
  • (V)(;,,;)(V)
  • IG name: Ethan.
Re: Moving Bridge and HD Roads Texture Mods
« Reply #1 on: June 27, 2016, 02:08 »
for the bridge, you should look up how to make a gate.. same concept there for both.... layers approaches, bridge goes down and or gate for, lets say a house, goes down..

for the HD roads, there are some on gtainside and they are all included for the specific area IE LS, LV, SF, Country.

Offline GodFatherDenzell

  • Sr. Member
  • ****
  • Posts: 407
  • cookies: 23
  • The GodMother
  • IG name: Pepe_The_Frog
Moving Bridge Script
« Reply #2 on: June 27, 2016, 10:04 »
Okay i need help now hahaha im having a headache... i've been configuring this codes for about 2 hours.. all i want is to move the bridge whenever a player comes nearly and comes back to it's position after the player left or passes by...

Here's my code : http://pastebin.com/DiiSAdFt
LAST SEEN
TOTAL TIME ON SERVER
SCORE
TRUCK LOADS
CONVOY SCORE
ACHIEVEMENTS
ARTIC
DUMPER
VAN
FUEL
CEMENT
ARRESTS
CARS STOLEN
COACH
PLANE
HELICOPTER
TOW TRUCK
LIMO
TRASH
ARMORED VAN
BURGLARIES
ARMORED VANS STOLEN
MISSIONS FAILED
OVERLOADED
FINES PAID
TOTAL SPENT ON FUEL
INTEREST EARNED
DISTANCE TRAVELLED
TIME IN JAIL
LAST MISSION
Generated by ASP.NET Core on Linux using the Convoy Trucking API. Updates every 5 minutes. See the original SVG image.

Offline CarlJohnson

  • Administrator
  • Hero Member
  • ******
  • Posts: 3,197
  • cookies: 85
  • Server Scripter
  • IG name: CarlJohnson
Re: Moving Bridge Script
« Reply #3 on: June 27, 2016, 10:06 »
"ERROR, PASTE ID IS INVALID, OR PASTE HAS BEEN REMOVED"
LAST SEEN
TOTAL TIME ON SERVER
SCORE
TRUCK LOADS
CONVOY SCORE
ACHIEVEMENTS
ARTIC
DUMPER
VAN
FUEL
CEMENT
ARRESTS
CARS STOLEN
COACH
PLANE
HELICOPTER
TOW TRUCK
LIMO
TRASH
ARMORED VAN

Offline Dobby

  • Hero Member
  • *****
  • Posts: 4,679
  • cookies: 120
  • No longer active.
Re: Moving Bridge Script
« Reply #4 on: June 27, 2016, 10:13 »
Streamer plugin, create a dynamic area. Use the relevant onplayerenterdynamicarea callback. Move Z to where you want it to be (down), once they've left the area move it back (up)
I have left SA:MP behind.

Offline CarlJohnson

  • Administrator
  • Hero Member
  • ******
  • Posts: 3,197
  • cookies: 85
  • Server Scripter
  • IG name: CarlJohnson
Re: Moving Bridge Script
« Reply #5 on: June 27, 2016, 10:26 »
I'll explain how it works, you can do what dobby told you or otherwise you can use IsPlayerInRangeOfPoint to see If the player is near the bridge, then use MoveObject to move the bridge accordingly

You can look at this topic for reference, works the same way but use bridge instead of gate
http://www.forum.convoytrucking.net/index.php?topic=27813.msg148525#msg148525
LAST SEEN
TOTAL TIME ON SERVER
SCORE
TRUCK LOADS
CONVOY SCORE
ACHIEVEMENTS
ARTIC
DUMPER
VAN
FUEL
CEMENT
ARRESTS
CARS STOLEN
COACH
PLANE
HELICOPTER
TOW TRUCK
LIMO
TRASH
ARMORED VAN

Offline GodFatherDenzell

  • Sr. Member
  • ****
  • Posts: 407
  • cookies: 23
  • The GodMother
  • IG name: Pepe_The_Frog
Re: Moving Bridge Script
« Reply #6 on: June 27, 2016, 10:34 »
I'll explain how it works, you can do what dobby told you or otherwise you can use IsPlayerInRangeOfPoint to see If the player is near the bridge, then use MoveObject to move the bridge accordingly

You can look at this topic for reference, works the same way but use bridge instead of gate
http://www.forum.convoytrucking.net/index.php?topic=27813.msg148525#msg148525

That's what i used.... first, creation of bridge first on PublicGameModeInit(), then second is IsPlayerInRangeOfPoint to check if player is near so if there is approaching player who entered the point the bridge will move down in around 5,000 milliseconds ... but i tried lol and didn't work...
LAST SEEN
TOTAL TIME ON SERVER
SCORE
TRUCK LOADS
CONVOY SCORE
ACHIEVEMENTS
ARTIC
DUMPER
VAN
FUEL
CEMENT
ARRESTS
CARS STOLEN
COACH
PLANE
HELICOPTER
TOW TRUCK
LIMO
TRASH
ARMORED VAN
BURGLARIES
ARMORED VANS STOLEN
MISSIONS FAILED
OVERLOADED
FINES PAID
TOTAL SPENT ON FUEL
INTEREST EARNED
DISTANCE TRAVELLED
TIME IN JAIL
LAST MISSION
Generated by ASP.NET Core on Linux using the Convoy Trucking API. Updates every 5 minutes. See the original SVG image.

Offline GodFatherDenzell

  • Sr. Member
  • ****
  • Posts: 407
  • cookies: 23
  • The GodMother
  • IG name: Pepe_The_Frog
Re: Moving Bridge Script
« Reply #7 on: June 27, 2016, 10:37 »
I'll explain how it works, you can do what dobby told you or otherwise you can use IsPlayerInRangeOfPoint to see If the player is near the bridge, then use MoveObject to move the bridge accordingly

You can look at this topic for reference, works the same way but use bridge instead of gate
http://www.forum.convoytrucking.net/index.php?topic=27813.msg148525#msg148525

Looks like this algorithm is easier... i will try it later and update you what i found :D i'll just still try to keep going on what i started before starting on new codes/process :D :like:
LAST SEEN
TOTAL TIME ON SERVER
SCORE
TRUCK LOADS
CONVOY SCORE
ACHIEVEMENTS
ARTIC
DUMPER
VAN
FUEL
CEMENT
ARRESTS
CARS STOLEN
COACH
PLANE
HELICOPTER
TOW TRUCK
LIMO
TRASH
ARMORED VAN
BURGLARIES
ARMORED VANS STOLEN
MISSIONS FAILED
OVERLOADED
FINES PAID
TOTAL SPENT ON FUEL
INTEREST EARNED
DISTANCE TRAVELLED
TIME IN JAIL
LAST MISSION
Generated by ASP.NET Core on Linux using the Convoy Trucking API. Updates every 5 minutes. See the original SVG image.

Offline CarlJohnson

  • Administrator
  • Hero Member
  • ******
  • Posts: 3,197
  • cookies: 85
  • Server Scripter
  • IG name: CarlJohnson
Re: Moving Bridge Script
« Reply #8 on: June 27, 2016, 13:32 »
Code: [Select]
MoveObject(bridge, 3079.1423, 264.0868, 39.5620, 5); //final: bridge will go up again
You have declared the bridge after you have forwarded the close()
It should be
Code: [Select]
public OnGameModeInit()
{
CreateDynamicObject(5333,-3211.7009300,264.0425100,12.8949000,0.0000000,0.0000000,180.0000000); //
CreateDynamicObject(9838,-3097.7165500,271.6612500,14.9262000,0.0000000,0.0000000,90.0000000); //
CreateDynamicObject(9690,-3097.8007800,256.5354300,14.9298000,0.0000000,0.0000000,90.0000000); //
 
bridge = CreateDynamicObject(18788,-3079.1423300,264.0867900,39.5620,0.0000000,0.0000000,0.0000000);
.
.
.
}

forward close ();
public close()
{
MoveObject(bridge, 3079.1423, 264.0868, 39.5620, 5); //final: bridge will go up again
return 1;
}

Atleast that's what I think :P
LAST SEEN
TOTAL TIME ON SERVER
SCORE
TRUCK LOADS
CONVOY SCORE
ACHIEVEMENTS
ARTIC
DUMPER
VAN
FUEL
CEMENT
ARRESTS
CARS STOLEN
COACH
PLANE
HELICOPTER
TOW TRUCK
LIMO
TRASH
ARMORED VAN

Offline GodFatherDenzell

  • Sr. Member
  • ****
  • Posts: 407
  • cookies: 23
  • The GodMother
  • IG name: Pepe_The_Frog
Re: Moving Bridge Script
« Reply #9 on: June 27, 2016, 13:42 »
There was another mistake on that code that i posted in paste bin... i didn't include the IsPlayerInRangePoint under the function of OnPlayerUpdate().. i forgot to include it in pastebin lol... should the forward close be after OnPlayerUpdate() or i'll do what you say? :)
LAST SEEN
TOTAL TIME ON SERVER
SCORE
TRUCK LOADS
CONVOY SCORE
ACHIEVEMENTS
ARTIC
DUMPER
VAN
FUEL
CEMENT
ARRESTS
CARS STOLEN
COACH
PLANE
HELICOPTER
TOW TRUCK
LIMO
TRASH
ARMORED VAN
BURGLARIES
ARMORED VANS STOLEN
MISSIONS FAILED
OVERLOADED
FINES PAID
TOTAL SPENT ON FUEL
INTEREST EARNED
DISTANCE TRAVELLED
TIME IN JAIL
LAST MISSION
Generated by ASP.NET Core on Linux using the Convoy Trucking API. Updates every 5 minutes. See the original SVG image.

Offline CarlJohnson

  • Administrator
  • Hero Member
  • ******
  • Posts: 3,197
  • cookies: 85
  • Server Scripter
  • IG name: CarlJohnson
Re: Moving Bridge Script
« Reply #10 on: June 27, 2016, 13:48 »
Code: [Select]
#include <a_samp>
#include <foreach>

new Bridge;
forward Timer();
forward BridgeDown();

main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
Bridge = CreateObject(....);
return 1;
}

public OnPlayerConnect(playerid)
{
SetTimer("Timer", 1000, 1);
return 1;
}

public Timer()
{
    for(new i=0; i<MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i))
{
    if(IsPlayerInRangeOfPoint(i, 5, x_coord, y_coord, z_coord))
{
    MoveObject(Bridge, x_coord, y_coord, z_coord, speed);
    SetTimer("BridgeDown", 5000, 0);
    return 1;
    }
}
}
}

public BridgeDown()
{
    MoveObject(Bridge, x_coord, y_coord, z_coord, speed);
    return 1;
}
LAST SEEN
TOTAL TIME ON SERVER
SCORE
TRUCK LOADS
CONVOY SCORE
ACHIEVEMENTS
ARTIC
DUMPER
VAN
FUEL
CEMENT
ARRESTS
CARS STOLEN
COACH
PLANE
HELICOPTER
TOW TRUCK
LIMO
TRASH
ARMORED VAN

Offline GodFatherDenzell

  • Sr. Member
  • ****
  • Posts: 407
  • cookies: 23
  • The GodMother
  • IG name: Pepe_The_Frog
Re: Moving Bridge Script
« Reply #11 on: June 27, 2016, 14:31 »
LAST SEEN
TOTAL TIME ON SERVER
SCORE
TRUCK LOADS
CONVOY SCORE
ACHIEVEMENTS
ARTIC
DUMPER
VAN
FUEL
CEMENT
ARRESTS
CARS STOLEN
COACH
PLANE
HELICOPTER
TOW TRUCK
LIMO
TRASH
ARMORED VAN
BURGLARIES
ARMORED VANS STOLEN
MISSIONS FAILED
OVERLOADED
FINES PAID
TOTAL SPENT ON FUEL
INTEREST EARNED
DISTANCE TRAVELLED
TIME IN JAIL
LAST MISSION
Generated by ASP.NET Core on Linux using the Convoy Trucking API. Updates every 5 minutes. See the original SVG image.

Offline Ethan

  • VIP
  • Hero Member
  • *****
  • Posts: 15,850
  • cookies: 229
  • (V)(;,,;)(V)
  • IG name: Ethan.
Re: Moving Bridge Script
« Reply #12 on: June 27, 2016, 15:01 »
but why make a new topic if you already had one open..
http://www.forum.convoytrucking.net/index.php?topic=54452.0

Offline GodFatherDenzell

  • Sr. Member
  • ****
  • Posts: 407
  • cookies: 23
  • The GodMother
  • IG name: Pepe_The_Frog
Re: Moving Bridge Script
« Reply #13 on: June 27, 2016, 15:49 »
i forgot lol because of programming -_-
LAST SEEN
TOTAL TIME ON SERVER
SCORE
TRUCK LOADS
CONVOY SCORE
ACHIEVEMENTS
ARTIC
DUMPER
VAN
FUEL
CEMENT
ARRESTS
CARS STOLEN
COACH
PLANE
HELICOPTER
TOW TRUCK
LIMO
TRASH
ARMORED VAN
BURGLARIES
ARMORED VANS STOLEN
MISSIONS FAILED
OVERLOADED
FINES PAID
TOTAL SPENT ON FUEL
INTEREST EARNED
DISTANCE TRAVELLED
TIME IN JAIL
LAST MISSION
Generated by ASP.NET Core on Linux using the Convoy Trucking API. Updates every 5 minutes. See the original SVG image.

Offline GodFatherDenzell

  • Sr. Member
  • ****
  • Posts: 407
  • cookies: 23
  • The GodMother
  • IG name: Pepe_The_Frog
Re: Moving Bridge and HD Roads Texture Mods
« Reply #14 on: June 28, 2016, 02:40 »
LAST SEEN
TOTAL TIME ON SERVER
SCORE
TRUCK LOADS
CONVOY SCORE
ACHIEVEMENTS
ARTIC
DUMPER
VAN
FUEL
CEMENT
ARRESTS
CARS STOLEN
COACH
PLANE
HELICOPTER
TOW TRUCK
LIMO
TRASH
ARMORED VAN
BURGLARIES
ARMORED VANS STOLEN
MISSIONS FAILED
OVERLOADED
FINES PAID
TOTAL SPENT ON FUEL
INTEREST EARNED
DISTANCE TRAVELLED
TIME IN JAIL
LAST MISSION
Generated by ASP.NET Core on Linux using the Convoy Trucking API. Updates every 5 minutes. See the original SVG image.