07.07.2012, 19:29
Quote:
Could you add a comment( // ) on each of the lines. What the following does, et cetra?
|
pawn Код:
CMD:gethere(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return 0; //Stops the function from continuing if they aren't an admin.
new target; //a variable to store our target in
if(sscanf(params, "r", target)) return SendClientMessage(playerid, 0xCC0000AA, "USAGE: /gethere [player]"); //Checks if inside of the parameters string is a players ID or name
new Float:tPos[3]; //we will store our players position in this array
GetPlayerPos(playerid, tPos[0], tPos[1], tPos[2]); //here we grab the players position and store it in the array we previously created
SetPlayerPos(target, tPos[0], tPos[1], tPos[2]); //we set the targets postion to the players position
return 1;
}