Gate with sprint key and jump key - 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: Gate with sprint key and jump key (
/showthread.php?tid=131541)
Gate with sprint key and jump key -
bartje01 - 03.03.2010
Hey guys. I was making my gate opening and close with sprint and jump
This is the code
Код:
if ((newkeys & 8) && !(oldkeys & 8))
if(IsPlayerInRangeOfPoint(playerid, 4.0, 1540.6035,-1626.6842,13.3828))
{
if(GetPlayerColor(playerid) == 0x2641FEAA || 0x33AA33AA)
{
MoveObject(lspdgate,1539.6375732422,-1619.1240234375,12.202730178833, 2.0);
}
else {
SendClientMessage(playerid, 0x33AA33AA, "You are not part of the UA or LSP!");
}
return 1;
}
Well. 2 problems.
It works when I am on foot. but not when I am in a car
When I am in a vehcile it opens when I stand close to it and move with W and S xD
on foot it works that I have to do jump and sprint
And it works for everyone not only for
if(GetPlayerColor(playerid) == 0x2641FEAA || 0x33AA33AA)
Please help
Re: Gate with sprint key and jump key -
bartje01 - 03.03.2010
Well I dont have to sprint for it but I want that the gate opens when you do Space in a car.
if ((newkeys &

&& !(oldkeys &

)
That
Re: Gate with sprint key and jump key -
Torran - 03.03.2010
Actulley you can
pawn Код:
if(newkeys == KEY_HANDBRAKE)
{
//Whatever here
}
Re: Gate with sprint key and jump key -
bartje01 - 03.03.2010
ye I know xD That is the same as this if ((newkeys &

&& !(oldkeys &

)
But I really need to fix all these stuff :P
Re: Gate with sprint key and jump key -
bartje01 - 03.03.2010
Quote:
Originally Posted by Seif_
Quote:
Originally Posted by Torran
Actulley you can
pawn Код:
if(newkeys == KEY_HANDBRAKE) { //Whatever here }
|
Handbrake is not sprint.
|
ACtualy. it is xD Because Sprinting is space and handbrake is space :P
But please help me now xD
Re: Gate with sprint key and jump key -
Torran - 03.03.2010
He said space key
Quote:
Originally Posted by bartje01
Well I dont have to sprint for it but I want that the gate opens when you do Space in a car.
if ((newkeys &  && !(oldkeys &  )
That
|
Re: Gate with sprint key and jump key -
bartje01 - 03.03.2010
Yeyeye xD Please help already xD Almost have to sleep and I wanna have it done before
Re: Gate with sprint key and jump key -
Torran - 03.03.2010
Quote:
Originally Posted by bartje01
Yeyeye xD Please help already xD Almost have to sleep and I wanna have it done before
|
pawn Код:
if(newkeys == KEY_HANDBRAKE)
{
//Whatever here
}
Re: Gate with sprint key and jump key -
bartje01 - 03.03.2010
seif. Then please show a example of your idea
Re: Gate with sprint key and jump key -
Torran - 03.03.2010
Quote:
Originally Posted by bartje01
seif. Then please show a example of your idea
|
Quote:
Originally Posted by Torran
Quote:
Originally Posted by bartje01
Yeyeye xD Please help already xD Almost have to sleep and I wanna have it done before
|
pawn Код:
if(newkeys == KEY_HANDBRAKE) { //Whatever here }
|