01.01.2011, 19:10
I need a command goto for ZCMD. I have searched in forum but i don't FIND.
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;
}
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.
if(!cgoto[targetid])return SendClientMessage(playerid, 0xFF0000FF, "ERROR: This players don0t admit other players to teleport to him");//1931 error here
if( !IsPlayerConnected( targetid ) ) return 0; // Targeted player is not connected