SA-MP Forums Archive
Just checking enter command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Just checking enter command (/showthread.php?tid=189527)



Just checking enter command - HrvojeCro - 12.11.2010

Should this be like this:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/enter", cmdtext, true, 10) ==0)////////////////////////////////////////
    {
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 2207.5254,-1100.4119,31.5547))//--House00000---
    {
        SetPlayerPos(playerid, 2209.3159,-1106.1302,14.9276);
        SetPlayerFacingAngle(playerid, 68.2839);
        SetCameraBehindPlayer(playerid);
        SetPlayerInterior(playerid, 10);
    }//--------------------------------------------------------------------------------
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 1412.0670,-1699.9690,13.5395))//--Bank001---
    {
        SetPlayerPos(playerid, 1415.951171,-988.971191,1639.980224);
        SetCameraBehindPlayer(playerid);
        SetPlayerInterior(playerid, 10);
    }
    return 1;
    }//--------------------------------------------------------------------------------
    return 0;
}
or like this:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/enter", cmdtext, true, 10) ==0)////////////////////////////////////////
    {
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 2207.5254,-1100.4119,31.5547))//--House00000---
    {
        SetPlayerPos(playerid, 2209.3159,-1106.1302,14.9276);
        SetPlayerFacingAngle(playerid, 68.2839);
        SetCameraBehindPlayer(playerid);
        SetPlayerInterior(playerid, 10);
    }//--------------------------------------------------------------------------------
    else if(IsPlayerInRangeOfPoint(playerid, 5.0, 1412.0670,-1699.9690,13.5395))//--Bank0001---
    {
        SetPlayerPos(playerid, 1415.951171,-988.971191,1639.980224);
        SetCameraBehindPlayer(playerid);
        SetPlayerInterior(playerid, 10);
    }
    return 1;
    }//--------------------------------------------------------------------------------
    return 0;
}



Re: Just checking enter command - TheXIII - 12.11.2010

else if is better.


Re: Just checking enter command - Rafa - 12.11.2010

ohh guys and i want to ask something like this i have make like first exsample of HrvojeCro
and when ill put the same interiorin 2 houses teleport me to the first one...
Please someone tell me what is the problem or i need to use with
pawn Код:
else if
I hope u understand me...
Thanks.

sorry for posting in same topics :/


Re: Just checking enter command - HrvojeCro - 12.11.2010

Quote:
Originally Posted by Rafa
Посмотреть сообщение
ohh guys and i want to ask something like this i have make like first exsample of HrvojeCro
and when ill put the same interiorin 2 houses teleport me to the first one...
Please someone tell me what is the problem or i need to use with
pawn Код:
else if
I hope u understand me...
Thanks.

sorry for posting in same topics :/
how do you know if its 1st house if there is same interior??
maybe you put on both houses same teleport coordinates??


Re: Just checking enter command - TheXIII - 12.11.2010

Quote:
Originally Posted by Rafa
Посмотреть сообщение
ohh guys and i want to ask something like this i have make like first exsample of HrvojeCro
and when ill put the same interiorin 2 houses teleport me to the first one...
Please someone tell me what is the problem or i need to use with
pawn Код:
else if
I hope u understand me...
Thanks.

sorry for posting in same topics :/
When you use same interior for two or more different places, then always use different virtualworlds as well. Then, when you teleport out of the interior, check which virtualworld player has. Then use it to teleport player back to the correct entrance.


Re: Just checking enter command - HrvojeCro - 12.11.2010

Quote:
Originally Posted by TheXIII
Посмотреть сообщение
When you use same interior for two different places, then always use different virtualworlds as well. Then, when you teleport out of the interior, check which virtualworld player has. Then use it to teleport player back to the correct entrance.
thats why i use my own interiors(yes it takes time to make 431671631 interiors but it worths) and there are no same interiors


Re: Just checking enter command - Rafa - 12.11.2010

hmmm how u mean defferent virtualworlds :/

where i need to put that wirtualwords ? :S


Re: Just checking enter command - TheXIII - 12.11.2010

Quote:
Originally Posted by Rafa
Посмотреть сообщение
hmmm how u mean defferent virtualworlds :/

where i need to put that wirtualwords ? :S
SetPlayerVirtualWorld(..) and GetPlayerVirtualWorld(..) are SA-MPs native functions.


Re: Just checking enter command - Rafa - 12.11.2010

soo the way is on every same interior to make SetPlayerVirtualWorld() right ?? :/
pawn Код:
if(strcmp("/enter", cmdtext, true, 10) ==0)
    {
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 2207.5254,-1100.4119,31.5547))//--House00000---
    {
        SetPlayerPos(playerid, 2209.3159,-1106.1302,14.9276);
        SetPlayerFacingAngle(playerid, 68.2839);
        SetCameraBehindPlayer(playerid);
        SetPlayerInterior(playerid, 10);
        SetPlayerVirtualWorld(playerid, 1);
    }//--------------------------------------------------------------------------------
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 1412.0670,-1699.9690,13.5395))//--Bank001---
    {
        SetPlayerPos(playerid, 1415.951171,-988.971191,1639.980224);
        SetCameraBehindPlayer(playerid);
        SetPlayerInterior(playerid, 10);
        SetPlayerVirtualWorld(playerid, 2);
    }
    return 1;
    }//--------------------------------------------------------------------------------
    return 0;
}
like this ? :/


Re: Just checking enter command - TheXIII - 12.11.2010

Umm.. kindof.

When player enters interior, set their VW unique to that entrance. So players won't see eachother, although they are in different "buildings". Also, on exit use GetPlayerVirtualWorld to teleport player back to the correct building entrance.

Also, there was/is a bug where chat collides when players are in same interior, but different VW's. You might also want to look into that.