dcmd_goto
#1

how would i add it so when you goto somebody on this command it teleports you to the interior their in aswell

because if somebodys in a interior and another person is in interior 0 and teleports to them it gets rly bugged

thanks


Код:
dcmd_goto(playerid,params[]){
    if(PInfo[playerid][Level] < 1) return SendClientMessage(playerid,red,"Your Not Allowed To Use This Command!");
    new id,string[128];
    if (sscanf(params,"u",id)) return SendClientMessage(playerid,LIGHTBLUE,"Usage: /goto [playerid]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,GREEN,"Player not connected");
    
    new Float:x,Float:y,Float:z;
    GetPlayerPos(id,x,y,z);
    if (IsPlayerInAnyVehicle(playerid)) {
        SetVehiclePos(GetPlayerVehicleID(playerid),x+3,y,z);
    } else {
	SetPlayerPos(playerid,x+3,y,z);
	}
    new pName[32];
    GetPlayerName(id,pName,32);
    format(string,sizeof string,"||You have teleported to %s||",pName);
    SendClientMessage(playerid,YELLOW,string);
    return 1;
}
Reply
#2

pawn Код:
dcmd_goto(playerid,params[]){
    if(PInfo[playerid][Level] < 1) return SendClientMessage(playerid,red,"Your Not Allowed To Use This Command!");
    new id,string[128];
    new world = GetPlayerVirtualWorld(playerid);
    new interior = GetPlayerInterior(playerid);
    if (sscanf(params,"u",id)) return SendClientMessage(playerid,LIGHTBLUE,"Usage: /goto [playerid]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,GREEN,"Player not connected");
    SetPlayerInterior(id,interior);
    SetPlayerVirtualWorld(id, world);
    SetPlayerInterior(playerid, GetPlayerInterior(id));
    SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
    new Float:x,Float:y,Float:z;
    GetPlayerPos(id,x,y,z);
    if (IsPlayerInAnyVehicle(playerid)) {
        SetVehiclePos(GetPlayerVehicleID(playerid),x+3,y,z);
    } else {
    SetPlayerPos(playerid,x+3,y,z);
    }
    new pName[32];
    GetPlayerName(id,pName,32);
    format(string,sizeof string,"||You have teleported to %s||",pName);
    SendClientMessage(playerid,YELLOW,string);
    return 1;
}
Try that
Reply
#3

dont worry ive fixed it thanks tho :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)