Creating PNS

Started by Mötley, Mar 15, 2016, 01:46 PM

Previous topic - Next topic

Mötley

So.... I want to build Pay and Sprays, But in this multiplayer there does not seem to be any added support for garage doors :o ??

I keep digging and digging and digging on this website and the wiki since yesterday morning and either I am blind or there is no added support for opening and closing garage doors?

Please Tell me I am blind :-[ !! This would be an awesome feature that I really desire in my server in general.



DizzasTeR

You can do it indirectly. Remove the doors from garages from the game world. Then add your own doors using CreateObject and then script their motion. Good luck.

The function to remove the main game objects and how to get their IDs I hope will be given to you by anyone else since I never felt the need to use it.

Mötley

I feared this rather than using features from the game.

This sounds like it could turn into a Nightmare as doors may mess up if a RPG hits it etc ( leaving a player defenseless as he is frozen in the timed proses LOL XD FAIL ..

I hope to ( Door IDS from someone )

Either way This is wasted time at this point( reason I could get a lot done in the server build compared to having a poor PNS that i am dissatisfied with, I was going to spend a whole week on building there perfections)

As well I do not know any clear objects that move back and forward and can be scripted other than garage doors :P

 

MacTavish

#3
Here is an example from my old script

onScriptLoad()
{
L_KEY <- BindKey(true, 0x4C, 0, 0); // L key
RawHideMapObject(2548,-3576,-5397,149);
g4 <- CreateObject(2548, 0, -357.619, -539.746, 14.975,255); // This is vercitty state garage door
g4.RotateToEuler(Vector(3.14159, 3.14159, -1.56661),0);
open4 <- false;
}

function MoveGate4(player,mgar, status)
{
local gard4=FindObject(mgar);
if(gard4)
{
if(status=="open")
{


MessagePlayer("Opening Gate",player);
gard4.MoveTo(Vector(-357.619, -542.746, 14.975),1800);
gard4.RotateToEuler(Vector(1.575, 1.57067, 0.0292034),1800);
PlaySound( 0, 143, player.Pos );
open4=true;
}
else if(status=="close")
{

MessagePlayer("Closing Gate",player);
gard4.MoveTo(Vector(-357.619, -539.746, 14.975),1800);
gard4.RotateToEuler(Vector(3.14159, 3.14159, -1.56661),1800);
PlaySound( 0, 145, player.Pos );
open4=false;

}
}
else MessagePlayer("Object could not be found.",player);
}

function onKeyDown( player, key )
{
if(key==L_KEY)
{
local mgar = InPoly( player.Pos.x, player.Pos.y, -353.466, -535.34, -361.864, -535.456, -361.77, -549.864, -353.471, -549.864 );
 if (mgar)
{
if(open4==false) MoveGate4(player,g4.ID,"open");
else MoveGate4(player,g4.ID,"close");
}
else MessagePlayer("You Need To Be Near Of Mansion Garage Gate To Open/Close",player);
}
}

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

Mötley

Quote from: Kusanagi on Mar 15, 2016, 02:07 PMHere is an example from my old script

onScriptLoad()
{
L_KEY <- BindKey(true, 0x4C, 0, 0); // L key
RawHideMapObject(2548,-3576,-5397,149);
g4 <- CreateObject(2548, 0, -357.619, -539.746, 14.975,255); // This is vercitty state garage door
g4.RotateToEuler(Vector(3.14159, 3.14159, -1.56661),0);
open4 <- false;
}

function MoveGate4(player,mgar, status)
{
local gard4=FindObject(mgar);
if(gard4)
{
if(status=="open")
{


MessagePlayer("Opening Gate",player);
gard4.MoveTo(Vector(-357.619, -542.746, 14.975),1800);
gard4.RotateToEuler(Vector(1.575, 1.57067, 0.0292034),1800);
PlaySound( 0, 143, player.Pos );
open4=true;
}
else if(status=="close")
{

MessagePlayer("Closing Gate",player);
gard4.MoveTo(Vector(-357.619, -539.746, 14.975),1800);
gard4.RotateToEuler(Vector(3.14159, 3.14159, -1.56661),1800);
PlaySound( 0, 145, player.Pos );
open4=false;

}
}
else MessagePlayer("Object could not be found.",player);
}

function onKeyDown( player, key )
{
if(key==L_KEY)
{
local mgar = InPoly( player.Pos.x, player.Pos.y, -353.466, -535.34, -361.864, -535.456, -361.77, -549.864, -353.471, -549.864 );
 if (mgar)
{
if(open4==false) MoveGate4(player,g4.ID,"open");
else MoveGate4(player,g4.ID,"close");
}
else MessagePlayer("You Need To Be Near Of Mansion Garage Gate To Open/Close",player);
}
]

I like that! I will play with it as is that get a better understanding of it then change it to something like is player in the scripted area if so open door.

Then build my own version:D Thanks

Murdock

Some scripting and 3d modeling do magic



Mötley

I like that! I see there is more possibilitys then I realized! other than a lot of stress testing. I may remove all the doors and set pay and sprays to be open at default on scriptload . Time to start digging threw garage ids ;)

MacTavish


Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

Mötley

#8
Doing stuff like this, Has it been known for garage doors to fall threw the ground if a rpg hits it, car runs into it? or someway somehow the door moves off of rotation. In general has any issues been known of with this, I am sure unprofesional scripting can lead to this mainly. I am just seeking correct measures on how this should be done?


Or could you let me know what i whould look out for etc? the goods...


While on the subject Map icons? I have been looking but I must be blind o_O

Murdock

Quote from: Mr_Motley on Mar 15, 2016, 05:08 PMDoing stuff like this, Has it been known for garage doors to fall threw the ground if a rpg hits it, car runs into it? or someway somehow the door moves off of rotation. In general has any issues been known of with this, I am sure unprofesional scripting can lead to this mainly. I am just seeking correct measures on how this should be done?

As far as I know the objects are static and do not disappear when being shot as with any other case where it could be damaged.

Quote from: Mr_Motley on Mar 15, 2016, 05:08 PMWhile on the subject Map icons? I have been looking but I must be blind o_O

You were not on that subject.. but anyway custom map icons are possible indeed.
Put your own icons in the directory store/mapicons. I am not sure what types of images are supported, but I used PNG with 120x120 pixels size. The filename should match the following structure; m<id>_<name>.png. For instance "m100_ctfblue.png". Then use CreateMarker to display those markers on the radar. Syntax: CreateMarker( int world, Vector pos, int size, RGB color, int iconID ).

Mötley

Quote from: Murdock on Mar 15, 2016, 05:25 PM
Quote from: Mr_Motley on Mar 15, 2016, 05:08 PMDoing stuff like this, Has it been known for garage doors to fall threw the ground if a rpg hits it, car runs into it? or someway somehow the door moves off of rotation. In general has any issues been known of with this, I am sure unprofesional scripting can lead to this mainly. I am just seeking correct measures on how this should be done?

As far as I know the objects are static and do not disappear when being shot as with any other case where it could be damaged.

Quote from: Mr_Motley on Mar 15, 2016, 05:08 PMWhile on the subject Map icons? I have been looking but I must be blind o_O

You were not on that subject.. but anyway custom map icons are possible indeed.
Put your own icons in the directory store/mapicons. I am not sure what types of images are supported, but I used PNG with 120x120 pixels size. The filename should match the following structure; m<id>_<name>.png. For instance "m100_ctfblue.png". Then use CreateMarker to display those markers on the radar. Syntax: CreateMarker( int world, Vector pos, int size, RGB color, int iconID ).

LOL sorry i meant to say"while we are on the topic of pay and sprays what about there icons"

Some of this is becoming very simple as I know how to script but do not know how some things are setup/ how to work things in,In this multiplayer.


I appreciate your Guidance!! Kudos!!. :D

BeckzyBoi

Sorry for replying in an old topic, but it beats making a new one I guess? - Does your game not crash if the server removes and recreates a garage door at the same position using the same model ID? ... it most certainly does in SA-MP...

DizzasTeR

Quote from: BeckzyBoi on Jun 27, 2018, 09:49 PMSorry for replying in an old topic, but it beats making a new one I guess? - Does your game not crash if the server removes and recreates a garage door at the same position using the same model ID? ... it most certainly does in SA-MP...

I'm sorry if I sound rude but please, to hell with SAMP, they are both different, stop comparing them and how they work, since you're new here from SAMP, I know you have alot of questions, but that doesn't mean if something crashes SAMP, VCMP will too, why don't you give it a try, I'm sure it will work if done correctly! :)

NicusorN5

^
Quote from: BeckzyBoi on Jun 27, 2018, 09:49 PMSorry for replying in an old topic, but it beats making a new one I guess? - Does your game not crash if the server removes and recreates a garage door at the same position using the same model ID? ... it most certainly does in SA-MP...
Short-answer: NO.

BeckzyBoi

Quote from: Doom_Kill3R on Jun 28, 2018, 05:45 AM
Quote from: BeckzyBoi on Jun 27, 2018, 09:49 PMSorry for replying in an old topic, but it beats making a new one I guess? - Does your game not crash if the server removes and recreates a garage door at the same position using the same model ID? ... it most certainly does in SA-MP...

I'm sorry if I sound rude but please, to hell with SAMP, they are both different, stop comparing them and how they work, since you're new here from SAMP, I know you have alot of questions, but that doesn't mean if something crashes SAMP, VCMP will too, why don't you give it a try, I'm sure it will work if done correctly! :)
They're both GTA games, they run on the same engine. Why spend 10 minutes trying it when I can spend 20 seconds making a post that I can later spend another 10-20 seconds checking back on? I'm also sorry if I sound rude, but I am developing a VC-MP gamemode from scratch. So I'm sorry if I don't have time to test all of my queries.

Quote from: Athanatos on Jun 28, 2018, 08:33 AM^
Quote from: BeckzyBoi on Jun 27, 2018, 09:49 PMSorry for replying in an old topic, but it beats making a new one I guess? - Does your game not crash if the server removes and recreates a garage door at the same position using the same model ID? ... it most certainly does in SA-MP...
Short-answer: NO.
Thanks :)