SA-MP Forums Archive
[HELP] Please! - 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: [HELP] Please! (/showthread.php?tid=99798)



[HELP] Please! - [NYRP]Mike. - 30.09.2009

Well i was wondering how i could do this, what i want to do is make a door open by a pressing 2 on your keyboard but everytime i try it just opens and i cant close it because its the same radius.

pawn Код:
new LD; //----Lock down gate in the Diner
new Sec; //----Security door in the Diner
new Locked[MAX_PLAYERS]; //----LOCKDOWN used for all doors / gates.
pawn Код:
Sec = CreateObject(1495, 2651.119873, -2745.723877, 4.287249, 0.0000, 0.0000, 89.3814);
    LD = CreateObject(971, 2640.496582, -2745.657959, 0.713324, 0.0000, 0.0000, 180.3777);
----=[[Below are the 1's i want on a Button]]=----
pawn Код:
if (strcmp("/opensec", cmdtext, true) == 0)
{
if(PlayerToPoint(2.0,playerid,2651.119873, -2745.723877, 4.287249))
        {
      if(TEAM_COP[playerid] == 1)
{
SetObjectRot(Sec, 0.0000, 0.0000, 18.9076);
}
}
return 1;
  }

if (strcmp("/closesec", cmdtext, true) == 0)
{
if(PlayerToPoint(2.0,playerid,2651.119873, -2745.723877, 4.287249))
{
 if(TEAM_COP[playerid] == 1)
{
SetObjectRot(Sec, 0.0000, 0.0000, 89.3814);
}
}
return 1;
}
So you press 2 it opens then closes in the certain radius.

Thanks.

-Mike.


Re: [HELP] Please! - dice7 - 30.09.2009

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

edit - whoa, they majorly updated the wiki page of this callback


Re: [HELP] Please! - Peter_Corneile - 30.09.2009

Quote:
Originally Posted by dice7
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange

edit - whoa, they majorly updated the wiki page of this callback
Lol yeah