Convoy Trucking

Hyde Park => GTA & SA-MP => Topic started by: Clucker on June 27, 2016, 01:25

Title: Moving Bridge and HD Roads Texture Mods
Post by: Clucker 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...

Title: Re: Moving Bridge and HD Roads Texture Mods
Post by: Ethan 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.
Title: Moving Bridge Script
Post by: Clucker 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
Title: Re: Moving Bridge Script
Post by: CarlJohnson on June 27, 2016, 10:06
"ERROR, PASTE ID IS INVALID, OR PASTE HAS BEEN REMOVED"
Title: Re: Moving Bridge Script
Post by: Dobby 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)
Title: Re: Moving Bridge Script
Post by: CarlJohnson 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
Title: Re: Moving Bridge Script
Post by: Clucker on June 27, 2016, 10:34
Quote from: CarlJohnson 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

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...
Title: Re: Moving Bridge Script
Post by: Clucker on June 27, 2016, 10:37
Quote from: CarlJohnson 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

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:
Title: Re: Moving Bridge Script
Post by: CarlJohnson on June 27, 2016, 13:32
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
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
Title: Re: Moving Bridge Script
Post by: Clucker 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? :)
Title: Re: Moving Bridge Script
Post by: CarlJohnson on June 27, 2016, 13:48
#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;
}
Title: Re: Moving Bridge Script
Post by: Clucker on June 27, 2016, 14:31
i give up lel http://pastebin.com/B2HVTZ9x  :ccmas: :o
Title: Re: Moving Bridge Script
Post by: Ethan 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
Title: Re: Moving Bridge Script
Post by: Clucker on June 27, 2016, 15:49
i forgot lol because of programming -_-
Title: Re: Moving Bridge and HD Roads Texture Mods
Post by: Clucker on June 28, 2016, 02:40
(http://s33.postimg.org/go4pq3mdr/windows_10.gif)
Title: Re: Moving Bridge and HD Roads Texture Mods
Post by: Clucker on June 28, 2016, 02:40
Scripting be like....

(http://s33.postimg.org/go4pq3mdr/windows_10.gif)
Title: Re: Moving Bridge and HD Roads Texture Mods
Post by: Clucker on June 29, 2016, 20:55
I did it! Loooool! Just place



[pastebin]http://pastebin.com/6pwezTWU[/pastebin]