Questions..(all my questions will be asked here..)
#1

Im trying to make a grenade launcher script... but i want to make it work in my custom map so. if i make a check like
pawn Code:
if(objid pos == place pos)
{
     destroy obj
     create explosion
}
would it lag.

Would making a If statement check in OnPlayerUpdate cause lots of lag?
How to add the Light to flashlight?
Reply
#2

Bump
Reply
#3

If you want a grenade launcher you already need a timer to update the movement of the grenade, maybe each 50 ms or faster (the speed of the grande matters / its range), in that timer just use a range check, it shouldn't lag at all
Reply
#4

here is my problem
pawn Code:
public Blah()
{
    new Object;
    return 1;
}

Forward LAD();
public LAD()
{
    SetObjectPos(Object, blah, blah , blah); // Error:::
    return 1;
}
Is there anyway to Connect the "new Object;" with the forward? i mean the object should be defined in the forward too.
Reply
#5

Quote:
Originally Posted by newbie scripter
View Post
Is there anyway to Connect the "new Object;" with the forward? i mean the object should be defined in the forward too.
Yes there is. All you would have to do is add a parameter to your LAD function. So it should be something like this:

pawn Code:
forward LAD(objectid);
public LAD(objectid)
{
    SetObjectPos(objectid, blah, blah , blah); // Error:::
    return 1;
}
After you have created the object you should do:
pawn Code:
new Object;
Object = CreateObject(...);
LAD(Object);
Reply
#6

Fail. i forgot to say, im using a timer.

Edit: How can i make a number go + 50 every second?
Reply
#7

Use a timer (SetTimerEx). Pass the number you want to be increased as a "d" specifier. Then, number += 50 should do it in the actual function.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)