13.12.2011, 22:04
just one and zcmd or?
here's one in ZCMD...
"/get <OtherPlayer>",
here's one in ZCMD...
"/get <OtherPlayer>",
pawn Код:
CMD:get(playerid, params[])
{
new getid; //creates the variable that we're going to be using to represent the param in sscanf
if(IsPlayerAdmin(playerid)) //checks if they're logged into RCON
{
new str[50], getname[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME]; //creates name vars n a string
new Float:x, Float:y, Float:z; //creates new variables so we can store the positions
if(sscanf(params, "u", getid)) return SendClientMessage(playerid, COLOR_RED,"USAGE: /get <playerid>"); //checks if the entered param is a playerid/name, if not sends the usage.
if(IsPlayerAdmin(getid)) return SendClientMessage(playerid, COLOR_RED,"You can't get an admin."); //checks if the other player is an admin. if not, sends an error message.
GetPlayerName(playerid, name, sizeof(name)); //gets name of the user
GetPlayerName(getid, getname, sizeof(getname)); //gets name of the other player
GetPlayerPos(playerid, x,y,z); //gets the players pos
SetPlayerPos(getid, x+3,y,z); //sets the other players pos
format(str,sizeof(str), "You have gotten %s", getname); //formats the message so we can send it
SendClientMessage(playerid, COLOR_RED, str); //sends the message to the player who typed it
format(str,sizeof(str), "%s has gotten you.", name); //formats the message so we can send it
SendClientMessage(getid, COLOR_RED, str); //sends the message to the other player
}
return 1;
}