/goto...
#1

Hay, Im trying to find a /goto cmd (tele player to player) but all the cmds I find is admin cmds... I dont want it to be admin cmd... Can anyone help me? :S
Reply
#2

Here try this :

pawn Код:
CMD:goto(playerid, params[])
{
  new Float:x, Float:y, Float:z;
  new playerid2;
  if(sscanf(params, "u", playerid2))
  {
    SendClientMessage(playerid, Orange, "USAGE : /goto [playerid]");
    SendClientMessage(playerid, Lightblue, "FUNCTION : Goto a particular players position");
  }
  else if(playerid2 == INVALID_PLAYER_ID) SendClientMessage(playerid, Red, "ERROR : That player is not connected!");
  else if(playerid2 == playerid) SendClientMessage(playerid, Red, "ERROR : You cant go to yourself!");
  else
  {
    GetPlayerPos(playerid2, x, y, z);
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
      LinkVehicleToInterior(GetPlayerVehicleID(playerid), GetPlayerInterior(playerid2));
      SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), GetPlayerVirtualWorld(playerid2));
      SetVehiclePos(GetPlayerVehicleID(playerid), x+2, y,z);
      SetVehicleZAngle(GetPlayerVehicleID(playerid),0.0);
    }
   else
   {
      SetPlayerPos(playerid, x+2, y, z);
      SetPlayerInterior(playerid, GetPlayerInterior(playerid2));
      SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(playerid2));
   }
 }
 return 1;
}
I used sscanf + zcmd.
Reply
#3

use that^^^

and note to the future:
if you want to remove the admin thing just find the if(something about admin) and delete it
Reply
#4

Код:
C:\Documents and Settings\ben\Desktop\junk\Server\filterscripts\cmds.pwn(350) : error 029: invalid expression, assumed zero
C:\Documents and Settings\ben\Desktop\junk\Server\filterscripts\cmds.pwn(350) : error 017: undefined symbol "cmd_goto"
C:\Documents and Settings\ben\Desktop\junk\Server\filterscripts\cmds.pwn(350) : error 029: invalid expression, assumed zero
C:\Documents and Settings\ben\Desktop\junk\Server\filterscripts\cmds.pwn(350) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Well... :S
Reply
#5

Get zcmd. If you don't know what that is, you might as well stop scripting now.
Reply
#6

I added #include <zcmd>... AND I have the zcmd.inc file in Pawno/inlude...
Reply
#7

Quote:
Originally Posted by Vince
Посмотреть сообщение
Get zcmd. If you don't know what that is, you might as well stop scripting now.
why zcmd? zcmd isn't much better than dcmd or just strcmp, he can script just fine without zcmd, but I would recommend getting it.
Reply
#8

Well.... Can anyone make something then?
Reply
#9

Well, the code is there. I think you put cmd_goto instead of CMD:goto
try changing it.
Reply
#10

no if anything like that gets called the compiler calls it as cmd_ like try putting 2 cmds with the same function/name

in the compiler it will say cmd_goto already defined

also daren zcmd is much better than dcmd+ strcmp.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)