How to enter building using ALT?
#1

You can read everything in title.
But i want to use it on GTA:RP, becouse if you walk into icon, than you will enter building. I hate that. Please help!
Reply
#2

'KEY_WALK'

pawn Код:
if(Keys & KEY_WALK)
{
//code? setplayerpos..
}
Reply
#3

Uhm. Explain please. Im not so advanced in that ..
Reply
#4

Quote:
Originally Posted by Sensitive
Посмотреть сообщение
You can read everything in title.
But i want to use it on GTA:RP, becouse if you walk into icon, than you will enter building. I hate that. Please help!
I guess you mean 'icon' that's pickups right?
In that case..

Try this:

pawn Код:
//On top of the script
#define KEY_WALK   1024 // This might not be necessary
 
new HasEntered[MAX_PLAYERS];
new KillThatThing;
 
//Under OnPlayerConnect
HasEntered[playerid] = 0;
 
//Under OnPlayerDisconnect
HasEntered[playerid] = 0;
 
//Under OnPlayerPickupPickup
//Place this under the desired pickup
HasEntered[playerid] = 1;
KillThatThing = SetTimer("KillEntering", 10000, 0);
 
 
OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  if(HasEntered[playerid] == 1)
  {
     if(newkeys == 1024)
     {
     //Do the setplayerpos here
     HasEntered[playerid] = 0;
     KillTimer(KillThatThing);
     }
  }
  return 1;
}
 
 
forward KillEntering(playerid);
public KillEntering(playerid)
{
  HasEntered[playerid] = 0;
}

NOTE: This ain't tested cuz im at work, have it a go tell me if there's anything wrong
Reply
#5

Can you say me, how do i remove that, if i walk into icon im entering the building to. So i can replace it with this. Im using GTA:RP.
Reply
#6

get the position on where you want to press the ALT key..
and then:
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  if ((oldkeys & KEY_WALK) && !(newkeys & KEY_WALK))
  {
    if(IsPlayerInRangeOfPoint(playerid, 2.0, x, y, z)) //replace with the position where to press the alt button
    {
      SetPlayerInterior(playerid, interiorid);
      SetPlayerPos(playerid, x, y, z);
    }
  }
  return 1;
}
if you have further questions to this code.. send me a PM :8
Reply
#7

howwwww to use? hahha is LIKe ............
Reply
#8

you should stop posting senseless stuff mr. ban evader...
reported you to sa-mp team....
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)