Need Command Goto (ZCMD)
#1

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

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;
}
Reply
#3

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
Reply
#4

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.
Reply
#5

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
Reply
#6

Nice ok Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)