No entering casino's
#1

Hi, i'm trying to make my script work so that players can't enter the casino. I don't get any errors, but still it doesn't work.. What's wrong with this?

Код:
forward casino(playerid);
public casino(playerid)
{

		if((GetPlayerInterior(playerid) == 10)) 
 			{
			SetPlayerInterior(playerid, 0);
			SetPlayerPos(playerid, 2048.8167,1002.0261,10.6719);
		 		}

					 return 1;

}
PS: As you might noticed, i'm quite new to this.
Reply
#2

Casinos are not only interior 10.
Also if you want it to be detected, you need to run a timer and have it check that interior over and over. Just placing something in your script doesnt mean its gonna work the way you want it.
Reply
#3

Quote:
Originally Posted by Kinetic
Casinos are not only interior 10.
Also if you want it to be detected, you need to run a timer and have it check that interior over and over. Just placing something in your script doesnt mean its gonna work the way you want it.
Yeah, it was just a test to see however one casino would work. So I need to place this code in public Timer?
Reply
#4

You need a function attached with:
SetTimer and IsPlayerInArea and SetPlayerPos with SetPlayerInterior. Done.
Reply
#5

there is a public called OnPlayerInteriorChange use that
pawn Код:
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
    if(newinteriorid == 10) //add here a PlayerToPoint check or something like that because interior 10 is not only used for casinos
    {
        SetPlayerInterior(playerid, 0);
        SetPlayerPos(playerid, 2048.8167, 1002.0261, 10.6719);
    }
    return true;
}
Reply
#6

Thanks! I had allready figured out a code myself, but if I use mine, or yours, the player spawns really high in the air, above the casino.. I redid a /save but still get the problem..
Reply
#7

where do you want to put him if he enters a casino ?
Reply
#8

Quote:
Originally Posted by ♣ ⓐⓢⓢ
where do you want to put him if he enters a casino ?
Just on the sidewalk next to the casino.
Reply
#9

ok first of all which casino you mean ? there is the 4 dragons, caligula and another noname (I think)
or you want it for all ?
Reply
#10

A little tip, just make a object blocking the entraces if you don't wanna use DisableInteriorEnterExits()
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)