Teleport command help! [REp+1]
#1

Hello guys.
i need help with some teleport cmd i got cmd /startevent and it works perfect it shows
Administrator [name] has started an event /join
and i need help, when you type /join teleports to admin who started event
how to do that?
help me pls, today is event on my server!
thanks
REP +1
_________________
IP : 188.40.57.132:7777
Drift - Generation
Reply
#2

Hey! This is usually called "goto-command" and has got the same function! So it is available for every player?

PHP код:
CMD:join(playeridparams[])
{
                    new 
ID;
                    new 
Float:xFloat:yFloat:z;
                   
// GetPlayerPos(ID, x, y, z);
                    
SetPlayerPos(playeridx+1y+1z); //Forget the X-Y-Z, type your own co-ords into here!
                    
            
            
return 1;
    } 
Reply
#3

You would first need to make global variables, you can't define them in one function!

I wrote this very quick. It is a MERE example. Don't copy/paste as it might not work.

pawn Код:
new
    Float:eventX, //These are the variables that will hold the even info.
    Float:eventY,
    Float:eventZ
    eventInterior,
    eventVirtualWorld;
new
    Event = 0; //This is basically a bool.

CMD:startevent(playerid,params[])
{
    if(!IsPlayerAdmin(playerid)) //This command is for RCON Admins only.
    {
        SendClientMessage(playerid,0xFFFFFFFF,"You are not an admin.");
        return 1;
    }
    if(Event = 1) //If an event has been started, this will show.
    {
        SendClientMessage(playerid,0xFFFFFFFF,"An event has already been started.");
        return 1;
    }
    else
    {
        new //Defines variables for the Admin's name and string that will be sent to everyone."
            AdminName[MAX_PLAYER_NAME],
            eventstring[128];
        GetPlayerName(playerid,AdminName,sizeof(MAX_PLAYER_NAME)); //This formats the string.
        format(string,sizeof(string),"Administrator %s has started an event! Use /joinevent to enter!",AdminName);
        SendClientMessageToAll(0xFFFFFFFF,string); //Send everyone the string.
        Event = 1; //Says that an event has been started.
        GetPlayerPos(playerid,eventX,eventY,eventZ); //These things below sets the event information to the Admin's position.
        GetPlayerInterior(playerid,eventInterior);
        GetPlayerVirtualWorld(playerid,eventVirtualWorld);
        return 1;
    }
}
CMD:joinevent(playerid,params[])
{
    if(Event == 0) //If no event is not started, then do this.
    {
        SendClientMessage(playerid,0xFFFFFFFF,"An event has not been started.");
        return 1;
    }
    else
    {
        SetPlayerPos(playerid,eventX,eventY,eventZ); //This sets the player's position ot the event start.
        SetPlayerVirtualWorld(playerid,eventVirtualWorld);
        SetPlayerInterior(playerid,eventInterior);
        return 1;
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)