Author Topic: [Tutorial]Automatic Gate  (Read 304 times)

Fitri

  • Newbie
  • *
  • Posts: 11
  • Reputation: 1
    • View Profile
[Tutorial]Automatic Gate
« on: April 21, 2013, 11:41:11 pm »
DELETED
« Last Edit: April 23, 2013, 11:17:47 pm by Fitri »

Share on Bluesky Share on Facebook


greentarch

  • Global Moderator
  • Newbie
  • ********
  • Posts: 16
  • Reputation: 0
    • View Profile
Re: [Tutorial]Automatic Gate
« Reply #1 on: April 22, 2013, 04:52:30 pm »
Wow.
Code: [Select]
public OnPlayerUpdate(playerid)
If you have 10 gates and you do it with that, it's not good.

Why not do a 1 seconds timer that runs without stopping instead of OnPlayerUpdate?

Fitri

  • Newbie
  • *
  • Posts: 11
  • Reputation: 1
    • View Profile
Re: [Tutorial]Automatic Gate
« Reply #2 on: April 22, 2013, 07:31:54 pm »
DELETED
« Last Edit: April 23, 2013, 11:18:09 pm by Fitri »

X-ZONE

  • Newbie
  • *
  • Posts: 1
  • Reputation: 0
    • View Profile
Re: [Tutorial]Automatic Gate
« Reply #3 on: April 22, 2013, 07:53:30 pm »
Ow .... xD

MezSteven

  • Scripting Helper
  • Newbie
  • *****
  • Posts: 2
  • Reputation: 0
    • View Profile
Re: [Tutorial]Automatic Gate
« Reply #4 on: April 22, 2013, 08:22:13 pm »
Put the codes properly, it is kinda hard to understand for new scripters, don't edited anything if you're posting codes else it will be messed up and it hard to understand.

greentarch

  • Global Moderator
  • Newbie
  • ********
  • Posts: 16
  • Reputation: 0
    • View Profile
Re: [Tutorial]Automatic Gate
« Reply #5 on: April 22, 2013, 10:31:37 pm »
P_P

public OnPlayerUpdate(playerid)//
{
   if(IsPlayerInRangeOfPoint(playerid, 5.0 ,898.536437,2088.507324,10.820312)) // if palyer in rage !!
   {
          MoveObject(bla2)//you can add more
   return 1;
if(IsPlayerInRangeOfPoint(playerid, 5.0 ,898.536437,2088.507324,10.820312)) // if palyer in rage !!
   {
          MoveObject(bla2)//you can add more
if(IsPlayerInRangeOfPoint(playerid, 5.0 ,898.536437,2088.507324,10.820312)) // if palyer in rage !!
   {
          MoveObject(bla2)//you can add more
          //easy ?
   return 1;
   return 1;
   }
   return 1;
}

That is not even a valid example.
How much you did "return 1;" ?

And I have said that putting it at OnPlayerUpdate ain't a good idea, because it get's called VERY FREQUENTLY PER SECOND FOR PLAYER. That's why I suggest you to use a one-second timer.