Help VirtualWorld -
Loloz - 24.09.2012
My problem is with this code
Код:
if (strcmp("/enter", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,5,1199.4426,-918.8450,43.1167)) //burger
{
SetPlayerPos(playerid,375.962463,-65.816848,1001.507812 );
SetPlayerInterior(playerid,10);
SetPlayerVirtualWorld(playerid,2);
}
else if(IsPlayerInRangeOfPoint(playerid,5,810.5773,-1615.8075,13.5469)) // burger
{
SetPlayerPos(playerid,375.962463,-65.816848,1001.507812 );
SetPlayerInterior(playerid,10);
SetPlayerVirtualWorld(playerid,3);
}
return 1;
}
if (strcmp("/exit", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,5,375.962463,-65.816848,1001.507812)) //burger
{
if ( GetPlayerVirtualWorld( playerid ) == 2 )
SetPlayerPos(playerid,1199.4426,-918.8450,43.1167 );
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
}
else if(IsPlayerInRangeOfPoint(playerid,5,375.962463,-65.816848,1001.507812)) //burger
{
if ( GetPlayerVirtualWorld( playerid ) == 3 )
SetPlayerPos(playerid,810.5773,-1615.8075,13.5469 );
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
}
return 1;
}
I've manage to get /enter in burger. but when i'm exit it, it makes me fall from the sky... Any help?
Re: Help VirtualWorld -
Rimeau - 24.09.2012
Код:
if (strcmp("/exit", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,5,375.962463,-65.816848,1001.507812)) //burger
{
if ( GetPlayerVirtualWorld( playerid ) == 2 )
{
SetPlayerPos(playerid,1199.4426,-918.8450,43.1167 );
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
}
}
else if(IsPlayerInRangeOfPoint(playerid,5,375.962463,-65.816848,1001.507812)) //burger
{
if ( GetPlayerVirtualWorld( playerid ) == 3 )
{
SetPlayerPos(playerid,810.5773,-1615.8075,13.5469 );
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
}
}
return 1;
}
Try this
Re: Help VirtualWorld -
Loloz - 24.09.2012
ok. i've replace it and...
Код:
if (strcmp("/exit", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,5,375.962463,-65.816848,1001.507812)) //burger --- Working ---
{
if ( GetPlayerVirtualWorld( playerid ) == 2 )
{
SetPlayerPos(playerid,1199.4426,-918.8450,43.1167 );
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
}
}
else if(IsPlayerInRangeOfPoint(playerid,5,375.962463,-65.816848,1001.507812)) //burger --- Not working ---
{
if ( GetPlayerVirtualWorld( playerid ) == 3 )
{
SetPlayerPos(playerid,810.5773,-1615.8075,13.5469 );
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
}
}
return 1;
}
The 2nd /enter is working, but /exit is not working anymore.
here is the /enter code too
Код:
if (strcmp("/enter", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,5,1199.4426,-918.8450,43.1167)) //burger Los Santos - Sus - Working
{
SetPlayerPos(playerid,375.962463,-65.816848,1001.507812 );
SetPlayerInterior(playerid,10);
SetPlayerVirtualWorld(playerid,2);
}
if(IsPlayerInRangeOfPoint(playerid,5,810.5773,-1615.8075,13.5469)) // burger Los Santos - Jos - NotWorking
{
SetPlayerPos(playerid,375.962463,-65.816848,1001.507812 );
SetPlayerInterior(playerid,10);
SetPlayerVirtualWorld(playerid,3);
}
return 1;
}
Re: Help VirtualWorld -
Rimeau - 24.09.2012
pawn Код:
if (strcmp("/exit", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,5,375.962463,-65.816848,1001.507812))
{
if(GetPlayerVirtualWorld(playerid) == 2)
{
SetPlayerPos(playerid,1199.4426,-918.8450,43.1167);
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
}
else if(GetPlayerVirtualWorld(playerid) == 3)
{
SetPlayerPos(playerid,810.5773,-1615.8075,13.5469);
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
}
}
return 1;
}
The problem was that the interior coordinates were the same in both if statements, so after checking the first one (which was true), it didn't check the second one
Re: Help VirtualWorld -
Loloz - 24.09.2012
Works perfect now. Thanks.
Re: Help VirtualWorld -
Loloz - 24.09.2012
i've got another problem now...
After i've put all burgers.
The virtualworld works perfect. but now. all my /enter/exit commands (except virtualworld burgers) don't work.
Hq-Police Department. and stuff...
why?
Re: Help VirtualWorld -
Rimeau - 24.09.2012
I will tell you if you post your /enter and /exit code ^^
Re: Help VirtualWorld -
Loloz - 24.09.2012
ok. this is an e.g. of School instructors hq.
Код:
if(strcmp(cmdtext, "/exit", true) == 0)
{
if PlayerToPoint(2,playerid,-2026.8184,-104.1917,1035.1719)
*then
{
SetPlayerPos(playerid,-2026.6027,-101.5817,35.1641);
SetPlayerInterior(playerid,0);
return 1;
}
}
if(strcmp(cmdtext, "/enter", true) == 0)
{
if(PlayerInfo[playerid][pMember] >= 0 || PlayerInfo[playerid][pLeader] >= 0)
{
if PlayerToPoint(2,playerid,-2026.6027,-101.5817,35.1641)
*then
{
SetPlayerPos(playerid,-2026.8184,-104.1917,1035.1719);
SetPlayerInterior(playerid,3);
SendClientMessage(playerid,COLOR_1GREEN,"*** Welcome to School instructor Hq!");
return 1;
}
}
}
if(strcmp(cmdtext, "/exit", true) == 0)
{
if PlayerToPoint(2,playerid,-2029.8463,-118.7292,1035.1719)
*then
{
SetPlayerPos(playerid,-2029.7997,-120.9881,35.1747);
SetPlayerInterior(playerid,0);
return 1;
}
}
if(strcmp(cmdtext, "/enter", true) == 0)
{
if(PlayerInfo[playerid][pMember] >= 0 || PlayerInfo[playerid][pLeader] >= 0)
{
if PlayerToPoint(2,playerid,-2029.7997,-120.9881,35.1747)
*then
{
SetPlayerPos(playerid,-2029.8463,-118.7292,1035.1719);
SetPlayerInterior(playerid,3);
SendClientMessage(playerid,COLOR_1GREEN,"*** Welcome to School instructor Hq!");
return 1;
}
}
}
Or Police department enter/exit
Код:
if(strcmp(cmdtext, "/exit", true) == 0)
{
if PlayerToPoint(5,playerid,246.7836,63.9013,1003.6406)
*then
{
SetPlayerPos(playerid,1552.4500,-1674.9900,16.1953);
SetPlayerInterior(playerid,0);
return 1;
}
}
if(strcmp(cmdtext, "/enter", true) == 0)
{
if(PlayerInfo[playerid][pMember] >= 0 || PlayerInfo[playerid][pLeader] >= 0)
{
if PlayerToPoint(5,playerid,1552.4500,-1674.9900,16.1953)
*then
{
SetPlayerPos(playerid,246.7836,63.9013,1003.6406);
SetPlayerInterior(playerid,6);
SendClientMessage(playerid,COLOR_1GREEN,"*** Welcome to Police Department!");
return 1;
}
}
}
The problem is that... all my houses or every /enter /exit that have been working on server shut down, after i put this virtualworld script for burger/pizza/24/7
Re: Help VirtualWorld -
Rimeau - 24.09.2012
You have to combine them all to ONE /enter, and ONE /exit command
Re: Help VirtualWorld -
Loloz - 24.09.2012
but howcome that the /enter /exit are working if i remove the virtual world burger enter/exits... ?