Interior -
TechSil - 21.05.2018
Hello guys i need tut or help how can i create like when you at bank and press f/enter anything to go in and then teleport you into custom interior. Please help me
Re: Interior -
DarkSkull - 21.05.2018
This is how you do it. Under the command called /enter, Check if the player is near a bank.
You can do this by using the function
IsPlayerInRangeOfPoint();. The X, Y, Z coord of the function corresponds to the X, Y, Z coord of the bank entrance. Then under the if statement, Set the player pos and his interior.
A list of interior ids and location can be found here:
CLICK ME
So in conclusion, Your code should look something like this.
PHP код:
if (strcmp("/enter", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, range, Float:x, Float:y, Float:z)) {
SetPlayerPos(playerid, Float:x, Float:y, Float:z);
SetPlayerInterior(playerid, interiorid);
}
return 1;
}
Re: Interior -
TechSil - 21.05.2018
Quote:
Originally Posted by DarkSkull
This is how you do it. Under the command called /enter, Check if the player is near a bank.
You can do this by using the function IsPlayerInRangeOfPoint();. The X, Y, Z coord of the function corresponds to the X, Y, Z coord of the bank entrance. Then under the if statement, Set the player pos and his interior.
A list of interior ids and location can be found here: CLICK ME
So in conclusion, Your code should look something like this.
PHP код:
if (strcmp("/enter", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, range, Float:x, Float:y, Float:z)) {
SetPlayerPos(playerid, Float:x, Float:y, Float:z);
SetPlayerInterior(playerid, interiorid);
}
return 1;
}
|
I didnt understand you at all
Re: Interior -
DarkSkull - 21.05.2018
Quote:
Originally Posted by TechSil
I didnt understand you at all
|
Do you know anything about scripting?
Re: Interior -
TechSil - 21.05.2018
Quote:
Originally Posted by DarkSkull
Do you know anything about scripting?
|
Not really
Re: Interior -
DarkSkull - 22.05.2018
Quote:
Originally Posted by TechSil
Not really
|
Okay, So I made a little error in the previous code. I misread your help.
Add this on top of your script.
PHP код:
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
Then put this under OnPlayerKeyStateChange.
PHP код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(PRESSED(KEY_SECONDARY_ATTACK)) {
if(IsPlayerInRangeOfPoint(playerid, 3, Float:x, Float:y, Float:z)) {
SetPlayerPos(playerid, 2315.952880,-1.618174,26.742187);
SetPlayerInterior(playerid, 0);
}
return 1;
}
Change the Float:x, Float:y, Float:z to the coords in front of the bank.
If You don't know how to script, I suggest you start with the basics first. This forum is filled with a lot of tutorials, You can how to make anything here. I should also remind you, since you're new here, that Scripting Help section is for helping other people with their code, not making it for them. All the best!