01.05.2009, 11:28
How can i do this that i don't have do write /enter do go in a house, i just go near the door and it automatically goes in? and if i go near the door inside the house it goes outside again
Originally Posted by [SaRp
Ryder ]
try an easy command with not so much variables .. like if(strcmp(cmd,"/enter",true ) == 0 ) } if(playertopoint bla bla ) { SetPlayerPos(bla bla SetPlayerInterior } if(playertopoint bla bla ) { SetPlayerPos(bla bla SetPlayerInterior return 1; } try to make it work because i just gave you an ideea ... i used this many times for my server and it was great ![]() |
new EnterHouse; forward AreaCheck(playerid);
EnterHouse = SetPlayerTimer("AreaCheck",1000,1);
Killtimer(AreaCheck);
IsPlayerInArea(playerid, Float:X1, Float:X2, Float:Y1, Float:Y2) { new Float:X, Float:Y, Float:Z; if(X1 > X2) { X = X2; X2 = X1; X1 = X; } if(Y1 > Y1) { Y = Y2; Y2 = Y1; Y1 = Y; } GetPlayerPos(playerid, X, Y, Z); if((X1 < X && X < X2) && (Y1 < Y && Y < Y2)) return 1; return 0; } public AreaCheck(playerid) { for(new i=0; i<MAX_PLAYERS; i++ ) { if(!IsPlayerConnected(i)) continue; if(IsPlayerInArea(i, 1923.388, 2847.478,-1930.57,-1492.37)) // here put in your coords it works like XMIN, XMAX,YMIN,YMAX { //Put here what the player have to do ... in your way a enter command ...but i don't know it } } }