SA-MP Forums Archive
Simple Script [HELP!!] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Simple Script [HELP!!] (/showthread.php?tid=104058)



Simple Script [HELP!!] - unique1801 - 22.10.2009

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!!



Re: Simple Script [HELP!!] - Rensy - 22.10.2009

hehe this good


Re: Simple Script [HELP!!] - dice7 - 22.10.2009

https://sampwiki.blast.hk/wiki/Automatic_Gates


Re: Simple Script [HELP!!] - unique1801 - 22.10.2009

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;
    }
  }
}



Re: Simple Script [HELP!!] - unique1801 - 22.10.2009

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



Re: Simple Script [HELP!!] - Virtual1ty - 22.10.2009

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!


Re: Simple Script [HELP!!] - unique1801 - 22.10.2009

i cant understand!

im totally new to scripting


Re: Simple Script [HELP!!] - Virtual1ty - 22.10.2009

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


Re: Simple Script [HELP!!] - unique1801 - 22.10.2009

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


Re: Simple Script [HELP!!] - unique1801 - 22.10.2009

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