Help with /enter , /exit
#1

Hey. I've been trying a lot latelt to add this position/pickup (either created or addstaticpickup) -2180.2656,602.8268,35.1691 and when I type /enter to go in Woozy Mu's house. Can somebody please help me do this? I've been trying for 6 hours already.
Reply
#2

I'm not 100% sure what you're after.

Do you want a pickup, so that when you walk into it it takes you to woozy's house?
Reply
#3

Quote:
Originally Posted by Weirdosport
I'm not 100% sure what you're after.

Do you want a pickup, so that when you walk into it it takes you to woozy's house?
Yes. A pickup to take you to Woozy's house. Like a /enter command but not a house. The problem is tried scripting one but when I got one the house's /enter and /exit were bugged so... . So yeah from the thar coord to take you the Woozy's house with a /enter command or something
Reply
#4

I really need to see how should it get scripted. With addstaticpickup the compiler crashes...
Reply
#5

Bump. Anyone can show me how to do it please?
Reply
#6

pawn Код:
#include <a_samp>

new woozy;

public OnFilterScriptInit()
{
    woozy = CreatePickup(4, 23, 0.0, 0.0, 15.0);
    return 1;
}

public OnFilterScriptExit()
{
    DestroyPickup(woozy);
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == woozy)
      {
      SetPlayerPos(playerid, -2180.2656,602.8268,35.1691);
      SendClientMessage(playerid, 0xFF00FFAA, "Welcome to Woozy's");
      }
    return 1;
}
This is a very basic script, that will spawn a pickup somewhere over the field in the center of the map. When you walk into the pickup it will take you to Woozy's. This script is just a guide, I do not recommend you use it, as it's very very basic, and Woozy's house is probably in an interior.

You need to change the "4" and "0.0, 0.0, 0.0" in the CreatePickup to suit your needs.

PS. Due to the use of "OnFilterscriptInit" and "OnFilterscriptExit" aswell as the use of "CreatePickup", this script can be loaded/unloaded while in game without causing problems. I also gave the pickup a name other than "pickup" or "pickup1" so it doesn't get confused with others. This name doesn't matter, so long as you use it consistently.
Reply
#7

Quote:
Originally Posted by Weirdosport
pawn Код:
#include <a_samp>

new woozy;

public OnFilterScriptInit()
{
    woozy = CreatePickup(4, 23, 0.0, 0.0, 15.0);
    return 1;
}

public OnFilterScriptExit()
{
    DestroyPickup(woozy);
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == woozy)
      {
      SetPlayerPos(playerid, -2180.2656,602.8268,35.1691);
      SendClientMessage(playerid, 0xFF00FFAA, "Welcome to Woozy's");
      }
    return 1;
}
This is a very basic script, that will spawn a pickup somewhere over the field in the center of the map. When you walk into the pickup it will take you to Woozy's. This script is just a guide, I do not recommend you use it, as it's very very basic, and Woozy's house is probably in an interior.

You need to change the "4" and "0.0, 0.0, 0.0" in the CreatePickup to suit your needs.

PS. Due to the use of "OnFilterscriptInit" and "OnFilterscriptExit" aswell as the use of "CreatePickup", this script can be loaded/unloaded while in game without causing problems. I also gave the pickup a name other than "pickup" or "pickup1" so it doesn't get confused with others. This name doesn't matter, so long as you use it consistently.
Thanks. I used
CreatePickup (1239, 2, -2180.2656,602.8268,35.1691);
Now the thing is I can't find OnFilterScriptInit() in the GF.pwn . Sorry if I am searching in the wrong place for that.
All I did now is create CreatePickup (1239, 2, -2180.2656,602.8268,35.1691); under OnGameModeInit().
What shell I do now cause I can't find OnFilterScriptInit().
Reply
#8

Put the stuff which I had in onfilterscriptinit and put it in ongamemodeinit, and the onfilterscriptexit stuff in the ongamemoveexit. Hadn't realised you were talking about a Gamemode >.>

You seem to have used pickup type "2". I read the wiki entry for this and it's:

2 - Pickupable, respawns after some time.
23 - Pickupable, but doesn't disappear on pickup.

I suggested using 23, but it's up to you.
Reply
#9

Quote:
Originally Posted by Weirdosport
Put the stuff which I had in onfilterscriptinit and put it in ongamemodeinit, and the onfilterscriptexit stuff in the ongamemoveexit. Hadn't realised you were talking about a Gamemode >.>
Forgot to mention I am using GodFather script...
Reply
#10

Also, if the co-ordinates of the pickup and the SetPlayerPos are the same it won't really do anything, be sure to edit them to suit your needs. And as Woozy Mu's is a building, you'll probably need to shove a SetPlayerInterior in there aswell. Check the Interior Page to find out which one it is!

Found it for you:

Woozies Apartment: 1

You'll need to add SetPlayerInterior(playerid, 1); underneath the SetPlayerPos line.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)