Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: FarisDon on Jan 29, 2016, 07:06 AM

Title: Object Thingy, but no error.
Post by: FarisDon on Jan 29, 2016, 07:06 AM
function onObjectShot(object,player,weapon)
{
if ( object.Model == 2546)
{
 Message("BLA");
}
}
Hi, Folks, as you can see the Code, i've tried my best to fix it, but i was unable to, and i wasn't getting any error as well, just shooting it, and tried different method of making this code, but it also doesn't show me any message "BLA"
So, i'm actually confused, Why? If their isn't any error than why the code isn't working?
P.S: sorry, for my bad English.
Title: Re: Object Thingy, but no error.
Post by: DizzasTeR on Jan 29, 2016, 07:16 AM
When you create objects you must manually set if the object should track shots/bumps or not.
local myObject  = CreateObject(... )
myObject.TrackingShots = true;


Now if you use that callback it should work.

Edit: More info http://forum.vc-mp.org/?topic=403.msg2591#msg2591
Title: Re: Object Thingy, but no error.
Post by: FarisDon on Jan 29, 2016, 07:56 AM
Quote from: Doom_Kill3R on Jan 29, 2016, 07:16 AMWhen you create objects you must manually set if the object should track shots/bumps or not.
local myObject  = CreateObject(... )
myObject.TrackingShots = true;

Now if you use that callback it should work.

Edit: More info http://forum.vc-mp.org/?topic=403.msg2591#msg2591
Well, I really appreciate your help! but i've one problem, or a question you can say, Do, I always have to make arrays like this  local myObject  <-  CreateObject(... ) this to enable Tracking shots? cause i've many Objects without this array, and i've tried to enable them without making this kinda array to them function onObjectShot(object,player,weapon)
{
object.TrackingShots = true;
if ( object.ID == 5) Message("BLA");
}
as you can see, and it doesn't worked! so is their any other way except making those array ( =, <-) stuff to make these work?
Edit: - Anyway thanks :) Topic Locked