Simple Script [HELP!!]
#1

Well
here it is


some fences here and i want it like! when some types /enter

The Fences Should open like this (or change their position)

im using elecfence_bar id - 987




Thanx!!
Reply
#2

hehe this good
Reply
#3

https://sampwiki.blast.hk/wiki/Automatic_Gates
Reply
#4

Can any one explain me out??
im a noob lol!!

im using 4 elecfence_BAR // id = 987





Код:
public CheckGate()
{
  for(new i = 0; i < GetMaxPlayers(); i++)
  {
    if(!IsPlayerConnected(i)) continue;
    if(PlayerToPoint(10.0, i, closed_X, closed_Y, closed_Z) && OpenGate[i] == 0)
    {
      MoveObject(c_gate, open_X, open_Y, open_Z);
      OpenGate[i] = 1;
    }
    else if(!PlayerToPoint(10.0, i, closed_X, closed_Y, closed_Z) && OpenGate[i] == 1)
    {
      MoveObject(c_gate, closed_X, closed_Y, closed_Z);
      OpenGate[i] = 0;
    }
  }
}
Reply
#5

well i tried myself using

Closed position :
-649.76745605469, 3350.1076660156, 19.643577575684
Open Position
-649.25280761719, 3349.5532226563, 25.729196548462

Object id : 987 (elecfence_Bar)

Код:
public CheckGate()
{
  for(new i = 0; i < GetMaxPlayers(); i++)
  {
    if(!IsPlayerConnected(i)) continue;
    if(PlayerToPoint(987, i, -649.76745605469, 3350.1076660156, 19.643577575684) && OpenGate[i] == 0)
    {
      MoveObject(c_gate, -649.25280761719, 3349.5532226563, 25.729196548462);
      OpenGate[i] = 1;
    }
    else if(!PlayerToPoint(987, i, -649.76745605469, 3350.1076660156, 19.643577575684) && OpenGate[i] == 1)
    {
      MoveObject(c_gate, -649.76745605469, 3350.1076660156, 19.643577575684);
      OpenGate[i] = 0;
    }
  }
}
got these errors

Код:
C:\Documents and Settings\Nish\Desktop\AC.pwn(216) : warning 235: public function lacks forward declaration (symbol "CheckGate")
C:\Documents and Settings\Nish\Desktop\AC.pwn(221) : error 017: undefined symbol "PlayerToPoint"
C:\Documents and Settings\Nish\Desktop\AC.pwn(221) : warning 215: expression has no effect
C:\Documents and Settings\Nish\Desktop\AC.pwn(221) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Nish\Desktop\AC.pwn(221) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Nish\Desktop\AC.pwn(221) : fatal error 107: too many error messages on one line
Reply
#6

Quote:
Originally Posted by unique1801
well i tried myself using

Closed position :
-649.76745605469, 3350.1076660156, 19.643577575684
Open Position
-649.25280761719, 3349.5532226563, 25.729196548462

Object id : 987 (elecfence_Bar)

Код:
public CheckGate()
{
  for(new i = 0; i < GetMaxPlayers(); i++)
  {
    if(!IsPlayerConnected(i)) continue;
    if(PlayerToPoint(987, i, -649.76745605469, 3350.1076660156, 19.643577575684) && OpenGate[i] == 0)
    {
      MoveObject(c_gate, -649.25280761719, 3349.5532226563, 25.729196548462);
      OpenGate[i] = 1;
    }
    else if(!PlayerToPoint(987, i, -649.76745605469, 3350.1076660156, 19.643577575684) && OpenGate[i] == 1)
    {
      MoveObject(c_gate, -649.76745605469, 3350.1076660156, 19.643577575684);
      OpenGate[i] = 0;
    }
  }
}
got these errors

Код:
C:\Documents and Settings\Nish\Desktop\AC.pwn(216) : warning 235: public function lacks forward declaration (symbol "CheckGate")
C:\Documents and Settings\Nish\Desktop\AC.pwn(221) : error 017: undefined symbol "PlayerToPoint"
C:\Documents and Settings\Nish\Desktop\AC.pwn(221) : warning 215: expression has no effect
C:\Documents and Settings\Nish\Desktop\AC.pwn(221) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Nish\Desktop\AC.pwn(221) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Nish\Desktop\AC.pwn(221) : fatal error 107: too many error messages on one line
...
Read the wiki fully!
Reply
#7

i cant understand!

im totally new to scripting
Reply
#8

just copy slowly the things that are shown there and you will get it
Reply
#9

please! i beg yaa!
i seriously cant understand!
ur a pro scripter so for ya its easy nt for me!!
Reply
#10

ok i tried following

and i got these errors
Код:
C:\Documents and Settings\Nish\My Documents\Pro\Admin.pwn(224) : error 017: undefined symbol "PlayerToPoint"
C:\Documents and Settings\Nish\My Documents\Pro\Admin.pwn(226) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Nish\My Documents\Pro\Admin.pwn(229) : error 017: undefined symbol "PlayerToPoint"
C:\Documents and Settings\Nisha\My Documents\Pro\Admin.pwn(231) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)