I need to know how to make a /enter command
#1

I want to know how to make A /ENTER command which teleports you to a location when typed.


AddPlayerClass(288,1570.9875,-1336.9447,16.4844,133.8545,0,0,0,0,0,0); // Bottom
AddPlayerClass(288,1548.6855,-1364.6135,326.2109,2.9033,0,0,0,0,0,0); // Top

Well basically I want to make a /enter command which teleports you to the top of star tower. I put Bottom and Top to show which is which. Bottom is where the /enter command is. Top is where your gonna be teleported. Please Please tell me how
Reply
#2

Huh?
do a simple command called /enter
SetPlayerPos(playerid,1570.9875,-1336.9447,16.4844);//to the building ,if not then put the second to this
Command for example /exit
SetPlayerPos(playerid,1548.6855,-1364.6135,326.2109);//teleport to anywhere
Reply
#3

Thats not what I mean. I wanna script it into my server and I don't want a /exit command
Reply
#4

You can use IsPlayerInRangeOfPoint to check the coordinates of a player, and SetPlayerPos to set a client's position.
Reply
#5

Can you give me Codes because thats what I don't know doing
Reply
#6

You can request code snippets here.
Reply
#7

pawn Code:
CMD:enter(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 7.0, 1570.9875, -1336.9447,16.4844))
    {
        SetPlayerPos(playerid, 1548.6855,-1364.6135,326.2109);
        GameTextForPlayer(playerid, "Welcome to the star tower!", 3000, 4)
    }
    else
    {
        SendClientMessage(playerid, COLOR, "You are not near an entrance!");
    }
    return 1;
}
EDIT:

Add this to your script aswell if you want a pickup.
pawn Code:
AddStaticPickup(1318, 1, 1570.9875, -1336.9447,16.4844, 0)
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)