PDA

View Full Version : How can i get into Ammunation?


Brandondw8
16/05/2014, 09:30 PM
I have my OnplayerConnect
DisableInteriorEnterExits();

soooo i cant go in ammunation anymore. but i dont want people going into cj's house an shit.

davve95
16/05/2014, 09:44 PM
Find the interior id and then SetPlayerPos:

http://wiki.sa-mp.com/wiki/SetPlayerPos
http://wiki.sa-mp.com/wiki/SetPlayerInterior
http://wiki.sa-mp.com/wiki/InteriorIDs


Edit: You could create a pick up for it if you wish:

http://wiki.sa-mp.com/wiki/CreatePickup
http://wiki.sa-mp.com/wiki/OnPlayerPickUpPickup


Can give more detailed info tomorrow if you would like to.

Brandondw8
16/05/2014, 09:45 PM
Find the interior id and then SetPlayerPos:

http://wiki.sa-mp.com/wiki/SetPlayerPos
http://wiki.sa-mp.com/wiki/SetPlayerInterior
http://wiki.sa-mp.com/wiki/InteriorIDs

Thanks man. +1

Brandondw8
16/05/2014, 10:10 PM
Find the interior id and then SetPlayerPos:

http://wiki.sa-mp.com/wiki/SetPlayerPos
http://wiki.sa-mp.com/wiki/SetPlayerInterior
http://wiki.sa-mp.com/wiki/InteriorIDs


Edit: You could create a pick up for it if you wish:

http://wiki.sa-mp.com/wiki/CreatePickup
http://wiki.sa-mp.com/wiki/OnPlayerPickUpPickup


Can give more detailed info tomorrow if you would like to.

Yeah that'd be great. All i want is for people to get into the amunations. Nothin else really.

Brandondw8
16/05/2014, 11:32 PM
Question for people.
If I want to add another lets say, armor to another place on the map, do i create a new pickup_Armor = CreatePickup coordinate string?

pickup_Armor = CreatePickup(1242, 2, 2464.1003,-1667.2505,13.4774, -1);
if(pickupid == pickup_Armor)
{
SetPlayerArmor(playerid, 100);
}

EDIT: Nevermind. Figured it out. Just dont know how to set ammunation interior

Dignity
17/05/2014, 12:04 AM
Since you figured the armor pickup out, I'll only show an example on how to create a custom entrance point using pickups. If you want me to give you an example of how to do the armor pickup, just reply and I'll. (:

I'm using these coordinates: X: 316.524993, Y: -167.706985, Z: 999.593750 which teleport you inside this (http://weedarr.wdfiles.com/local--files/interior/Amu5.jpg) ammu nation. You can find more interiors here[/u] (]http://weedarr.wikidot.com/interior[u). The "x, y, z" coordinates are to be replaced with the coordinates of the ammu nation entrance.

This should work:


// Top of your script

new pickup_Enter;
new pickup_Exit;

// OnGameModeInit - 1239 = info pickup
pickup_Enter = CreatePickup(1239, 2, x, y, z, -1); // 1239 = info pickup
pickup_Exit = CreatePickup(1239, 2, 316.524993, -167.706985, 999.593750, -1); // coords = ammunation

// Pickup callback
if(pickupid == pickup_Enter)
{
SetPlayerPos(playerid, 316.524993, -167.706985, 999.593750);
SetPlayerInterior(playerid, 6); // int is 6
}

if(pickupid == pickup_Exit)
{
SetPlayerPos(playerid, x, y, z);
SetPlayerInterior(playerid, 0); // int is 0
}

Brandondw8
17/05/2014, 12:25 AM
Since you figured the armor pickup out, I'll only show an example on how to create a custom entrance point using pickups. If you want me to give you an example of how to do the armor pickup, just reply and I'll. (:

I'm using these coordinates: X: 316.524993, Y: -167.706985, Z: 999.593750 which teleport you inside this (http://weedarr.wdfiles.com/local--files/interior/Amu5.jpg) ammu nation. You can find more interiors here[/u] (]http://weedarr.wikidot.com/interior[u). The "x, y, z" coordinates are to be replaced with the coordinates of the ammu nation entrance.

This should work:


// Top of your script

new pickup_Enter;
new pickup_Exit;

// OnGameModeInit - 1239 = info pickup
pickup_Enter = CreatePickup(1239, 2, x, y, z, -1); // 1239 = info pickup
pickup_Exit = CreatePickup(1239, 2, 316.524993, -167.706985, 999.593750, -1); // coords = ammunation

// Pickup callback
if(pickupid == pickup_Enter)
{
SetPlayerPos(playerid, 316.524993, -167.706985, 999.593750);
SetPlayerInterior(playerid, 6); // int is 6
}

if(pickupid == pickup_Exit)
{
SetPlayerPos(playerid, x, y, z);
SetPlayerInterior(playerid, 0); // int is 0
}



Woo!
After much starting the game, going to the ammunation, /save coords i did it. I can enter/exit the downtown LS ammunation. Now to get the npc there, check point and weapons....

DavidBilla
17/05/2014, 12:28 AM
What kind of an NPC are you gonna be using? An immobile one standing in same place?

Brandondw8
17/05/2014, 12:30 AM
What kind of an NPC are you gonna be using? An immobile one standing in same place?

Yes. just one where I can go into the marker and purchase the weapons. the npc doesnt need to do anything special

Ramoboss
17/05/2014, 12:32 AM
http://forum.sa-mp.com/showthread.php?t=355372

here it is ^^

Brandondw8
17/05/2014, 12:34 AM
http://forum.sa-mp.com/showthread.php?t=355372

here it is ^^

Looks complicated. I'll give it a shot!

Dignity
17/05/2014, 12:37 AM
As for the checkpoints:

http://wiki.sa-mp.com/wiki/SetPlayerCheckpoint

You can get the dialog codes from here:
http://wiki.sa-mp.com/wiki/Dialog
http://wiki.sa-mp.com/wiki/OnDialogResponse


public OnPlayerEnterCheckpoint(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, x, y, z)) // x, y, z = coordinates - same as setplayercheckpoint
{
ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapons", "AK47\nM4\nSniper Rifle", "Option 1", "Option 2");
}

return 1;
}


You can make the checkpoint appear after they entered (aka under pickup_Enter's callback).

Brandondw8
17/05/2014, 12:39 AM
As for the checkpoints:

http://wiki.sa-mp.com/wiki/SetPlayerCheckpoint

You can get the dialog codes from here:
http://wiki.sa-mp.com/wiki/Dialog
http://wiki.sa-mp.com/wiki/OnDialogResponse


public OnPlayerEnterCheckpoint(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, x, y, z)) // x, y, z = coordinates - same as setplayercheckpoint
{
ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapons", "AK47\nM4\nSniper Rifle", "Option 1", "Option 2");
}

return 1;
}


You can make the checkpoint appear after they entered (aka under pickup_Enter's callback).

I have no idea how to get a .rec file for an npc to follow

Dignity
17/05/2014, 02:41 AM
Did you look at Ramoboss' URL or didn't it work for you?

Brandondw8
17/05/2014, 03:24 AM
Did you look at Ramoboss' URL or didn't it work for you?

Yeah it looked really confusing. New to pawn code.