public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/enter", true))
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 2116.3108,-1279.5417,13.5469))
{
SetPlayerPos(playerid, 286.148986,-40.644397,1001.515625);//AmmunationEntrance
SetPlayerInterior(playerid, 1);
}
if(IsPlayerInRangeOfPoint(playerid, 3.0, 4366.3108,-1279.5417,13.5469))
{
SetPlayerPos(playerid, 286.148986,-40.644397,1001.515625);//AmmunationEntrance
SetPlayerInterior(playerid, 1);
}
}
if(!strcmp(cmdtext, "/exit", true))
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 286.148986,-40.644397,1001.515625))
{
SetPlayerPos(playerid, 2116.3108,-1279.5417,13.5469);//AmmunationExit
SetPlayerInterior(playerid, 0);
}
if(IsPlayerInRangeOfPoint(playerid, 3.0, 286.148986,-40.644397,1001.515625))
{
SetPlayerPos(playerid, 4366.3108,-1279.5417,13.5469);//AmmunationExit
SetPlayerInterior(playerid, 0);
}
}
return 1;
}
SetPlayerVirtualWorld(playerid, worldid)
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/enter", true))
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 2116.3108,-1279.5417,13.5469))
{
SetPlayerPos(playerid, 286.148986,-40.644397,1001.515625);//AmmunationEntrance
SetPlayerInterior(playerid, 1);
SetPlayerVirtualWorld(playerid, 1)
}
if(IsPlayerInRangeOfPoint(playerid, 3.0, 4366.3108,-1279.5417,13.5469))
{
SetPlayerPos(playerid, 286.148986,-40.644397,1001.515625);//AmmunationEntrance
SetPlayerInterior(playerid, 1);
SetPlayerVirtualWorld(playerid, 2)
}
}
if(!strcmp(cmdtext, "/exit", true))
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 286.148986,-40.644397,1001.515625))
{
SetPlayerPos(playerid, 2116.3108,-1279.5417,13.5469);//AmmunationExit
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0)
}
if(IsPlayerInRangeOfPoint(playerid, 3.0, 286.148986,-40.644397,1001.515625))
{
SetPlayerPos(playerid, 4366.3108,-1279.5417,13.5469);//AmmunationExit
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0)
}
}
return 1;
}
When entering the Idlewood barber shop set the player's vw to 2 for ex.
However when entering the Market's barber shop set it to 3. Now when you /exit, check the player's vw (GetPlayerVirualWorld) if its == 2, set the idlewood coords, if its == 3 set the market exit coords. |
When entering the Idlewood barber shop set the player's vw to 2 for ex.
However when entering the Market's barber shop set it to 3. Now when you /exit, check the player's vw (GetPlayerVirualWorld) if its == 2, set the idlewood coords, if its == 3 set the market exit coords. |
if(!strcmp(cmdtext, "/exit", true)) { if(IsPlayerInRangeOfPoint(playerid, 3.0, 286.148986,-40.644397,1001.515625)) { if(GetPlayerVirtualWorld(playerid) == 2) { SetPlayerPos(playerid, 2116.3108,-1279.5417,13.5469);//AmmunationExit } else if(GetPlayerVirtualWorld(playerid) == 3) { SetPlayerPos(playerid, 4366.3108,-1279.5417,13.5469);//AmmunationExit } SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0) } } return 1;