All pastes #366489 Raw Edit

Unnamed

public text v1 · immutable
#366489 ·published 2007-02-21 18:35 UTC
rendered paste body
dcmd_goto(playerid,params[])  {
	new index=0;
	tmps1 = strtok(params, index);
	if(!strlen(tmps1) || !IsNumeric(tmps1)) {
		SendClientMessage(playerid, COLOR_ADMIN_CMD, "* USAGE: /goto [playerid]. This will teleport you to [playerid].");
		return 1;
	}

	giveplayerid = strval(tmps1);

	if(IsPlayerConnected(giveplayerid)) {
        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		GetPlayerName(playerid, playername, sizeof(sendername));
		SetPlayerInterior(playerid, 0);
		SetPlayerPos(playerid, X250[giveplayerid], Y250[giveplayerid], Z250[giveplayerid] + 5);
		SetCameraBehindPlayer(playerid);
		format(strings, sizeof(strings), "--- %s (id: %d) teleported himself to %s (id: %d)", playername,playerid,giveplayer,giveplayerid);
		printf(strings);
		format(strings, sizeof(strings), "* You teleported yourself to %s (id: %d).", giveplayer,giveplayerid);
		SendClientMessage(playerid, COLOR_GREEN, strings);
	} else {
		format(strings, sizeof(strings), "* %d is not an active player.", giveplayerid);
		SendClientMessage(playerid, COLOR_GREEN, strings);
	}

	return 1;
}