No entering casino's -
ArnoVL - 20.03.2009
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.
Re: No entering casino's -
Kinetic - 20.03.2009
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.
Re: No entering casino's -
ArnoVL - 20.03.2009
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?
Re: No entering casino's -
Rks25 - 20.03.2009
You need a function attached with:
SetTimer and IsPlayerInArea and SetPlayerPos with SetPlayerInterior. Done.
Re: No entering casino's -
Nero_3D - 20.03.2009
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;
}
Re: No entering casino's -
ArnoVL - 20.03.2009
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..
Re: No entering casino's -
Nero_3D - 21.03.2009
where do you want to put him if he enters a casino ?
Re: No entering casino's -
ArnoVL - 21.03.2009
Quote:
Originally Posted by ♣ ⓐⓢⓢ
where do you want to put him if he enters a casino ?
|
Just on the sidewalk next to the casino.
Re: No entering casino's -
Nero_3D - 21.03.2009
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 ?
Re: No entering casino's -
LarzI - 21.03.2009
A little tip, just make a object blocking the entraces if you don't wanna use DisableInteriorEnterExits()