SA-MP Forums Archive
Problem! - 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: Problem! (/showthread.php?tid=163882)



Problem! - dovys11 - 29.07.2010

I got a problem...
I want to use the same interior for two shops and assign different wirtual worlds for 'em...
The problem is... How I can find that virtual world when player wants to exit from that shop?


Re: Problem! - Mimic - 29.07.2010

What, so the virtual worlds for each shops are different? but when they exit that shop you want it back to normal?


Re: Problem! - Jeffry - 29.07.2010

pawn Код:
public OnPlayerInteriorChange(playerid,newinteriorid,oldinteriorid)
{
   if(oldinteriorid==/*Shop one*/)
   {
       if(GetPlayerVirtualWorld(playerid)==/*Your World*/)
       {
          //Do whatever you want here
       }

       if(GetPlayerVirtualWorld(playerid)==/*Your other World*/)
       {
          //Do whatever you want here
       }
   }
   return 1;
}
I hope this helps you.

Greetz,
Jeffry



Re: Problem! - dovys11 - 29.07.2010

Quote:
Originally Posted by Mimic
Посмотреть сообщение
What, so the virtual worlds for each shops are different? but when they exit that shop you want it back to normal?
Yep...

Quote:
Originally Posted by Jeffry
Посмотреть сообщение
pawn Код:
public OnPlayerInteriorChange(playerid,newinteriorid,oldinteriorid)
{
   if(oldinteriorid==/*Shop one*/)
   {
       if(GetPlayerVirtualWorld(playerid)==/*Your World*/)
       {
          //Do whatever you want here
       }

       if(GetPlayerVirtualWorld(playerid)==/*Your other World*/)
       {
          //Do whatever you want here
       }
   }
   return 1;
}
I hope this helps you.

Greetz,
Jeffry
Well... This doesn't help me really... I'm doing entry to that shop with command...

And you could explain the code you write a bit because I'm pawno beginner


Re: Problem! - Jeffry - 29.07.2010

Post your command here.


Re: Problem! - dovys11 - 29.07.2010

Quote:
Originally Posted by Jeffry
Посмотреть сообщение
Post your command here.
Currently like this...

pawn Код:
if(strcmp("/enter_shop", cmdtext, true, 10) == 0)
        {
        if(IsPlayerInRangeOfPoint(playerid, 5, 1315.4927, -900.8430, 39.5781)) //Shop 1
            {
            SetPlayerVirtualWorld(playerid, 1);
            SetPlayerInterior(playerid, 18);
            SetPlayerPos(playerid, -30.9467,-89.6096,1003.5469);
            }
        else if(IsPlayerInRangeOfPoint(playerid, 5, 1831.5411,-1843.3800,13.5781))
            {
            SetPlayerVirtualWorld(playerid, 2);
            SetPlayerInterior(playerid, 18);
            SetPlayerPos(playerid, -30.9467,-89.6096,1003.5469);
            }
        else
            {
            SendClientMessage(playerid, 0xFF0000FF, "You're not near 24/7 Shop door!");
            }
        return 1;
    }



Re: Problem! - Jeffry - 29.07.2010

But this works, right?

And what do you need now? I didn't get what you mean in the first post. Do you need an /exit_shop or what?



Re: Problem! - Mimic - 29.07.2010

What he wants is when he enters the shop it changes his VirtualWorld, but when he exits the shop he wants it to set to his orignal and everybody elses VirtualWorld, or somthing like that I'm not 100% sure read my post above or wait for him to post with more detail


Re: Problem! - dovys11 - 29.07.2010

Nevermind... I already did it... Thanks anyway...


Re: Problem! - Jeffry - 29.07.2010

Quote:
Originally Posted by dovys11
Посмотреть сообщение
Nevermind... I already did it... Thanks anyway...
Ah, thats always the best. Have fun!