/goto help [REP]
#1

I need a command !FOR PLAYER!
that it will teleport player to player

Somebody?
Reply
#2

cba to add the messages so i'll let you to do it.

pawn Код:
CMD:tp(playerid, params[]){
    new id, id2, Float:x, Float:y, Float:z;
    if(sscanf(params,"uu", id, id2)) return SendClientMessage(playerid, -1, "USAGE: tp [id] to [id2]");
    GetPlayerPos(id2, x, y, z);
    SetPlayerPos(id, x, y, z);
    return 1;
}
Reply
#3

and if you wonna to tp to player wich your vehicle
PHP код:
CMD:goto(playeridparams[])
{
    new 
ID;
    if(
sscanf(params"u"ID)) SendClientMessage(playerid, -1"USAGE: /goto [playerid]");
    else if(
IsPlayerConnected(ID) == 0SendClientMessage(playerid, -1"Player is not connected!");
    else
    {
        new 
Float:XFloat:YFloat:ZFloat:Angle;
        if(
IsPlayerInAnyVehicle(ID))GetVehiclePos(GetPlayerVehicleID(ID), XYZ), GetVehicleZAngle(GetPlayerVehicleID(ID), Angle);
        else 
GetPlayerPos(IDXYZ), GetPlayerFacingAngle(playeridAngle);
        if(
IsPlayerInAnyVehicle(playerid))SetVehiclePos(GetPlayerVehicleID(playerid), X+1.0Y+1.0Z), SetVehicleZAngle(GetPlayerVehicleID(playerid), Angle);
        else 
SetPlayerPos(playeridX+1.0Y+1.0Z), SetPlayerFacingAngle(playeridAngle);
    }
    return 
true;

Reply
#4

pawn Код:
C:\Users\eesti\Desktop\SAMP\gamemodes\Dream.pwn(73) : error 017: undefined symbol "params"
C:\Users\eesti\Desktop\SAMP\gamemodes\Dream.pwn(73) : error 001: expected token: ")", but found "return"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Reply
#5

pawn Код:
CMD:goto(playerid, params[])
{
        new targetid, Float:x, Float:y, Float:z;
        if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /goto [id]");
        if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, "That player is not connected");
        GetPlayerPos(targetid, x, y, z);
        SetPlayerPos(playerid, x, y+0.5, z+0.5);
        return 1;
}
Reply
#6

Quote:
Originally Posted by doreto
Посмотреть сообщение
and if you wonna to tp to player wich your vehicle
PHP код:
CMD:goto(playeridparams[])
{
    new 
ID;
    if(
sscanf(params"u"ID)) SendClientMessage(playerid, -1"USAGE: /goto [playerid]");
    else if(
IsPlayerConnected(ID) == 0SendClientMessage(playerid, -1"Player is not connected!");
    else
    {
        new 
Float:XFloat:YFloat:ZFloat:Angle;
        if(
IsPlayerInAnyVehicle(ID))GetVehiclePos(GetPlayerVehicleID(ID), XYZ), GetVehicleZAngle(GetPlayerVehicleID(ID), Angle);
        else 
GetPlayerPos(IDXYZ), GetPlayerFacingAngle(playeridAngle);
        if(
IsPlayerInAnyVehicle(playerid))SetVehiclePos(GetPlayerVehicleID(playerid), X+1.0Y+1.0Z), SetVehicleZAngle(GetPlayerVehicleID(playerid), Angle);
        else 
SetPlayerPos(playeridX+1.0Y+1.0Z), SetPlayerFacingAngle(playeridAngle);
    }
    return 
true;

wtf: it needs a params when i add #pragma unused params it will give me 2 warnings
WTF?
Reply
#7

...do you use the default system processor for commands?


EDIT: LOL no one of you didn't understand what he wants.
Reply
#8

Код:
CMD:goto(playerid,params[]) {
    if(PlayerInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid)) {
	    if(isnull(params)) return SendClientMessage(playerid,red,"USAGE: /goto [playerid]");
	    new player1, string[128];
		if(!IsNumeric(params)) player1 = ReturnPlayerID(params);
	   	else player1 = strval(params);
	 	if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid) {
		//	CMDMessageToAdmins(playerid,"GOTO");
			new Float:x, Float:y, Float:z;	GetPlayerPos(player1,x,y,z); SetPlayerInterior(playerid,GetPlayerInterior(player1));
			SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(player1));
			if(GetPlayerState(playerid) == 2) {
				SetVehiclePos(GetPlayerVehicleID(playerid),x+3,y,z);	LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(player1));
				SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),GetPlayerVirtualWorld(player1));
			} else SetPlayerPos(playerid,x+2,y,z);
			format(string,sizeof(string),"You have teleported to \"%s\"", pName(player1));
			return SendClientMessage(playerid,blue,string);
		} else return SendClientMessage(playerid, red, "Player is not connected or is yourself");
	} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}
Reply
#9

I NEED COMMAND LIKE /GOTO! For all of players!
Reply
#10

Quote:
Originally Posted by James Coral
Посмотреть сообщение
wtf: it needs a params when i add #pragma unused params it will give me 2 warnings
WTF?
noone have say that you have to "add #progma unset params" you just need sscanf2 include lol i test wichout that and work fine
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)