/goto, /get, /getthere
#5

pawn Код:
CMD:get(playerid, params[])
{
    if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "Usage: /Get < Player ID >"); // Didn't complete the command

    new
        pID = strval(params),
        Float:g_Pos[3]; // Needed to hold the player's position ( The one who used the cmd ), array of 3: x , y , z

    if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "User is not connected!"); // Check if the user we are getting is online

    GetPlayerPos(playerid, g_Pos[0], g_Pos[1], g_Pos[2]); // Getting the player's position and storing it into our array

    SetPlayerPos(pID, g_Pos[0], g_Pos[1], g_Pos[2]); // Setting the player that we selected, 'pID' and setting his position to the player that used the cmd 'playerid'
    return 1;
}
pawn Код:
CMD:goto(playerid, params[])
{
    if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "Usage: /Get < Player ID >"); // Didn't complete the command

    new
        pID = strval(params),
        Float:g_Pos[3]; // Needed to hold the player's position ( The targeted player ), array of 3: x , y , z

    if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "User is not connected!"); // Check if the user we are getting is online

    GetPlayerPos(pID, g_Pos[0], g_Pos[1], g_Pos[2]); // Getting our target's position and storing it onto our variables

    SetPlayerPos(playerid, g_Pos[0], g_Pos[1], g_Pos[2]); // Setting the player who used the cmd to our target's location
    return 1;
}
pawn Код:
CMD:gothere(playerid, params[]) // /GoThere 0.0 0.0 0.0
{
    new
        Float:g_Pos[3];

    if(sscanf(params, "fff", g_Pos[0], g_Pos[1], g_Pos[2])) return SendClientMessage(playerid, COLOR_RED, "Usage: /GoThere < X > < Y > < Z >");

    return SetPlayerPos(playerid, g_Pos[0], g_Pos[1], g_Pos[2]);
}
Reply


Messages In This Thread
/goto, /get, /getthere - by Markx - 19.03.2011, 09:14
Re: /goto, /get, /getthere - by Biesmen - 19.03.2011, 09:18
Re: /goto, /get, /getthere - by Markx - 19.03.2011, 09:22
Re: /goto, /get, /getthere - by PinkFloydLover - 19.03.2011, 09:24
Re: /goto, /get, /getthere - by [L3th4l] - 19.03.2011, 09:24
Re: /goto, /get, /getthere - by Pooh7 - 19.03.2011, 09:27
Re: /goto, /get, /getthere - by Markx - 19.03.2011, 09:31
Re: /goto, /get, /getthere - by Markx - 19.03.2011, 09:46
Re: /goto, /get, /getthere - by Biesmen - 19.03.2011, 10:25

Forum Jump:


Users browsing this thread: 2 Guest(s)