SA-MP Forums Archive
Need Command Goto (ZCMD) - 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: Need Command Goto (ZCMD) (/showthread.php?tid=205570)



Need Command Goto (ZCMD) - SamyRomafia - 01.01.2011

I need a command goto for ZCMD. I have searched in forum but i don't FIND.


Re: Need Command Goto (ZCMD) - Grim_ - 01.01.2011

pawn Код:
COMMAND:goto( playerid, params[ ] )
{
   if( isnull( params ) ) return 0; // No player
   new targetid = strval( params );
   if( !IsPlayerConnected( targetid ) ) return 0; // Targeted player is not connected
   new Float: Pos[ 4 ];
   GetPlayerPos( targetid, Pos[ 0 ], Pos[ 1 ], Pos[ 2 ] );
   GetPlayerFacingAngle( targetid, Pos[ 3 ] );
   SetPlayerPos( playerid, Pos[ 0 ], Pos[ 1 ], Pos[ 2 ] );
   SetPlayerFacingAngle( playerid, Pos[ 3 ] );
   return 1;
}



Re: Need Command Goto (ZCMD) - SamyRomafia - 01.01.2011

Quote:
Originally Posted by Grim_
Посмотреть сообщение
pawn Код:
COMMAND:goto( playerid, params[ ] )
{
   if( isnull( params ) ) return 0; // No player
   new targetid = strval( params );
   if( !IsPlayerConnected( targetid ) ) return 0; // Targeted player is not connected
   new Float: Pos[ 4 ];
   GetPlayerPos( targetid, Pos[ 0 ], Pos[ 1 ], Pos[ 2 ] );
   GetPlayerFacingAngle( targetid, Pos[ 3 ] );
   SetPlayerPos( playerid, Pos[ 0 ], Pos[ 1 ], Pos[ 2 ] );
   SetPlayerFacingAngle( playerid, Pos[ 3 ] );
   return 1;
}
Thanks Grim.

Respect


Re: Need Command Goto (ZCMD) - SamyRomafia - 01.01.2011

I dont create a new topic i use this

pawn Код:
/*Goto*/
CMD:goto(playerid, params[])
{
   if(!cgoto[gotoid])return SendClientMessage(playerid, 0xFF0000FF, "ERROR: This players don0t admit other players to teleport to him");//1931 error here
   if( isnull( params ) ) return 0; // No player
   new targetid = strval( params );
   if( !IsPlayerConnected( targetid ) ) return 0; // Targeted player is not connected
   new Float: Pos[ 4 ];
   GetPlayerPos( targetid, Pos[ 0 ], Pos[ 1 ], Pos[ 2 ] );
   GetPlayerFacingAngle( targetid, Pos[ 3 ] );
   SetPlayerPos( playerid, Pos[ 0 ], Pos[ 1 ], Pos[ 2 ] );
   SetPlayerFacingAngle( playerid, Pos[ 3 ] );
   return 1;
}

CMD:enablegoto(playerid, params[])
{
        if(cgoto[playerid])return SendClientMessage(playerid, 0xFFFF00FF, "Server: You have already allow other players goto tou.");
        cgoto[playerid] = true;
        return SendClientMessage(playerid, 0x00FF00FF, "Server: You have allowed other players goto you");
}

CMD:disablegoto(playerid, params[])
{
        if(!cgoto[playerid])return SendClientMessage(playerid, 0xFFFF00FF, "Server: You have already forbid other players goto you");
        cgoto[playerid] = false;
        return SendClientMessage(playerid, 0xFF0000FF, "Server: You have forbid other players goto you");
}
Код:
C:\Users\proprietario\Desktop\Drifting Stunting Racing\gamemodes\DSRClan.pwn(1931) : error 017: undefined symbol "gotoid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: Need Command Goto (ZCMD) - Grim_ - 01.01.2011

Please place this line:
pawn Код:
if(!cgoto[targetid])return SendClientMessage(playerid, 0xFF0000FF, "ERROR: This players don0t admit other players to teleport to him");//1931 error here
After this line:
pawn Код:
if( !IsPlayerConnected( targetid ) ) return 0; // Targeted player is not connected



Re: Need Command Goto (ZCMD) - SamyRomafia - 01.01.2011

Nice ok Thanks