public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/enter", true)){
if(IsPlayerInRangeOfPoint(playerid, 13.0, x,y,z)){//the place that you want the player be to /enter
SetPlayerInterior(playerid,interiorid);//get the interior http://weedarr.wikidot.com/interior
SetPlayerPos(playerid,y,x,z);//interior pos http://weedarr.wikidot.com/interior
GameTextForPlayer(playerid,"Welcome to the Interior!",4000,6);//change interior to anything else
return 1;
}
}
if(!strcmp(cmdtext, "/exit", true)){
if(IsPlayerInRangeOfPoint(playerid, 15.0, x,y,z)){//the place you want the player type /enter from
SetPlayerInterior(playerid,0);//always 0
SetPlayerPos(playerid,x,y,z);//the original place that he typed /enter from
GameTextForPlayer(playerid,"you left the interior !",4000,6);
return 1;
}
}
return 0;
}
Originally Posted by daastle
My main problem is I wanted the yellow triangle that faces down as the entry point , but I cannot find it anywhere, and I dont know if its a pickup , marker , just no idea.
|
public OnGameModeInit() {
CreatePickup(1559, 23, X, Y, Z, VirtualWorld);
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/enter", true))
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, X, Y, Z)) //This checks to see if the player is within the marker
{
SetPlayerInterior(playerid, interiorid);//
SetPlayerPos(playerid, X, Y, Z);//interior pos http://weedarr.wikidot.com/interior
}
return 1;
}
if(!strcmp(cmdtext, "/exit", true))
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, X, Y, Z))
{
SetPlayerInterior(playerid, interiorid);
SetPlayerPos(playerid, X, Y, Z);
}
return 1;
}
return 0;
}
Originally Posted by daastle
So here is my idea.I want to make , lets say , a bank . So what I want to enter is an automatic "get close to the door" thing.
|
pawn Код:
|
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/enter", true))
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, X, Y, Z)) //This checks to see if the player is within the marker
{
SetPlayerInterior(playerid, interiorid);//
SetPlayerVirtualWorld(playerid,worldid)
SetPlayerPos(playerid, X, Y, Z);//interior pos http://weedarr.wikidot.com/interior
}
return 1;
}
if(!strcmp(cmdtext, "/exit", true))
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, X, Y, Z))
{
SetPlayerInterior(playerid, interiorid);
SetPlayerVirtualWorld(playerid,worldid)
SetPlayerPos(playerid, X, Y, Z);
}
return 1;
}
return 0;
}
The yellow marker outside on buildings on single-player is a pickup and it's ID is 1559
So you would have to create the marker however you create your 'bank' or what ever then you'd have to use 'IsPlayerInRangeOfPoint' in a callback which I am not quite sure what you'd put it under. |
new bankPickup; // lets first create the pickup. This is a global variable so it goes outside any callback
OnGameModeInit() {
bankPickup = CreatePickup(1559, 2, 0.0, 0.0, 4.0); // create the pickup and assign the ID to the variable
}
OnPlayerPickUpPickup(playerid, pickupid) {
if(pickupid == bankPickup) { // the player has activated the created pickup
SetPlayerPos(playerid, 0.0, 0.0, 15.0); // Yes, all it does now is just throw the player in the air some more
SendClientMessage(playerid, 0x00FF00AA, "Welcome to the bank (yea, there is no bank here)"); // send a message so they know what happened
return 1;
}
}