Garsino House System - help
#3

That doesn't have to be tested in order to see that you have failed. Where are you getting the value for pickupid from?? First of all, you need the coordinates of your pickup.
pawn Код:
CreatePickup(model, 1, 156.23, 1996.24, -19.532, -1)
So our coordinates would be:
156.23, 1996.24, -19.532

Remember to make sure that your pickup type is '1'. As the second parameter in the above code shows, so the pickup will not disappear when the player enters it, see HERE for further information.

Then we will need to take those coordinates, and insert them into our OnPlayerKeyStateChange, seeing as you are looking for the 'enter' button, I am assuming you have the default settings, as ****** usually explains to me in this case, the keys are only what the player has defined, so by assumption, I'm guessing your KEY_SECONDARY_ATTACK is currently set as 'Enter/Return'.

The code would be as follows:
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys == KEY_SECONDARY_ATTACK)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2, 156.23, 1996.24, -19.532)) //This is where we insert the coordinates, which can be replaced by your enum data as well.
        {
            SetPlayerInterior(playerid, houseinterior); //Your house interior will go here.
            SetPlayerPos(playerid, houseposx, houseposy, houseposz); //Your house coords will go here
            //SetPlayerFacingAngle(playerid, houseangle); //Optional, but might be necessary.
        }
        //Code continues...
    }
    return 1;
}
This is an example code of what you should really be doing.
Reply


Messages In This Thread
Garsino House System - help - by Saddin - 30.12.2012, 08:06
Re: Garsino House System - help - by ikbenremco - 30.12.2012, 09:21
Re: Garsino House System - help - by Threshold - 30.12.2012, 09:56
Re: Garsino House System - help - by Saddin - 30.12.2012, 11:20
Re: Garsino House System - help - by Threshold - 30.12.2012, 22:21
Re: Garsino House System - help - by Saddin - 31.12.2012, 21:56

Forum Jump:


Users browsing this thread: 2 Guest(s)