Problem!
#1

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?
Reply
#2

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

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
Reply
#4

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
Reply
#5

Post your command here.
Reply
#6

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;
    }
Reply
#7

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?
Reply
#8

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
Reply
#9

Nevermind... I already did it... Thanks anyway...
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)