[Help]Entrance & Exit Scripting
#1

Does anyone know.How can I make for a house/ prison cell system.That they enter right in their own cells/homes.


I will give u some screens for better explanation. Please help.





Thanks for all helpers.
Reply
#2

Go to the interior, stand OUTSIDE the interior like in the second pic, /save [Outside co-ordinates].
Then go inside the prison, /save [INSIDE co-ordinates.]
Then use them in your commands, like
pawn Code:
CMD:enterjail(playerid, params[])
{
       if(IsPlayerInRangeOfPoint(playerid, Your Outside jail X cordinate, Y, Z) /*If player is outside jail and wanting to go in. */
       SetPlayerPos(playerid, INSIDE X co-ordinates, y, z);
return 1;
}
Reply
#3

Does It have any easier solution? Because I found one cell system from , a mod , but dont know how he scripted it.


And it\'s dynamic, and it creates the interior alone , but it creates the right position.
Reply
#4

https://sampwiki.blast.hk/wiki/SetPlayerVirtualWorld

He was probably using this function, so it was a different virtual world for every player.
Ways to do this are:
pawn Code:
CMD:enter(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(...
    {
        SetPlayerPos(playerid, ....
        SetPlayerVirtualWorld(playerid, playerid); //Why is there 2 playerid\'s here? Because nobody has the same player id, so there will never be two players in the same virtual world at once.
    }
    return 1;
}
Or without the use of playerid and house id instead:
pawn Code:
CMD:enter(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(...
    {
        SetPlayerPos(playerid, ....
        SetPlayerVirtualWorld(playerid, HouseInfo[houseidhere][ID]); //Nobody has the same house ID, unless they\'re both entering the same house.
    }
    return 1;
}
The second method is a better option, especially in the cases when you have it set so other players can enter your house.
Reply
#5

Look , how it is by this script. All have their own interiors.You will never enter to other cells.Only at yours.


Watch at screens

Reply
#6

So you can assign each cell an integer, like House IDs. Then save it into the player\'s saving file or row, i.e. in INI or MySQL. While jailing him, get the integer and put him in that cell.
Reply
#7

I want it like home system.That people can enter & exit when they want.Not to jail them as a cop.


But dont know how can I make that they enter in right cell.
Reply
#8

I found the solution...Ty anyways
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)