[dcmd] goto problems - 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 problems (
/showthread.php?tid=254781)
[dcmd] goto problems -
jonnyboy - 12.05.2011
I really need help with this! D:
everything is right and gives no error BUT the goto command don't work right. it sends you to somewhere else
here is the code:
pawn Код:
dcmd_goto(playerid,params[])
{
if(PlayerInfo[playerid][AdminLevel] < 1) return SendClientMessage(playerid, COLOR_RED, "You are not authorized to use that command!");
new player1;
if(sscanf(params, "u", player1)) return SendClientMessage(playerid, COLOR_RED, "Usage: /goto [playerid]");
new Float:XX, Float:YY, Float:ZZ;
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
SetPlayerPos(playerid, XX, YY, ZZ);
SetPlayerVirtualWorld(player1, GetPlayerVirtualWorld(playerid));
SetPlayerInterior(player1,GetPlayerInterior(playerid));
}
return true;
}
can someone help me?
Respuesta: [dcmd] goto problems -
K9- - 12.05.2011
pawn Код:
dcmd_goto(playerid,params[])
{
if(PlayerInfo[playerid][AdminLevel] < 1) return SendClientMessage(playerid, COLOR_RED, "You are not authorized to use that command!");
new player1;
if(sscanf(params, "u", player1)) return SendClientMessage(playerid, COLOR_RED, "Usage: /goto [playerid]");
new Float:XX, Float:YY, Float:ZZ;
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
GetPlayerPos(player1, XX, YY, ZZ);//
SetPlayerPos(playerid, XX, YY, ZZ);
SetPlayerVirtualWorld(player1, GetPlayerVirtualWorld(playerid));
SetPlayerInterior(player1,GetPlayerInterior(playerid));
}
return true;
}
Re: [dcmd] goto problems -
Laronic - 12.05.2011
pawn Код:
dcmd_goto(playerid, params[])
{
if(PlayerInfo[playerid][AdminLevel] == 0) return SendClientMessage(playerid, COLOR_RED, "You are not authorized to use that command!");
{
new targetid;
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0xFFFFFFAA, "USAGE: /goto [playerid | name]");
else if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xFFFFFFAA, "That player is not connected");
{
new Float:PosX, Float:PosY, Float:PosZ;
GetPlayerPos(targetid, PosX, PosY, PosZ);
SetPlayerPos(playerid, PosX, PosY, PosZ);
SetPlayerInterior(playerid, GetPlayerInterior(targetid));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(targetid));
}
}
return 1;
}
And on
"SetPlayerVirtualWorld"
"SetPlayerInterior"
Your getting you own Vw and interior, and not the player you want to teleport to