dcmd_goto - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: dcmd_goto (
/showthread.php?tid=244844)
dcmd_goto -
hadzx - 28.03.2011
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;
}
Re: dcmd_goto -
xir - 28.03.2011
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
Re: dcmd_goto -
hadzx - 28.03.2011
dont worry ive fixed it thanks tho :P