19.03.2011, 09:24
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]);
}