CMD:goto(playerid, params[]) { new string[256]; if ( sscanf( params, "u", params[ 0 ]) )return SendClientMessage(playerid, COLOR_ORANGE, "You can use /pgoto <on/off> to disable enable people to come to you"),SendUsage( playerid, "/goto <id>" ); if (P_DATA[ params[ 0 ] ][ P_Goto ] == 0 && P_DATA[ playerid ][ P_Level ] < 1 )return format(string,sizeof( string ), "ERROR: %s has the goto turned off.", PlayerName2( params[ 0 ])),SendClientMessage(playerid, COLOR_RED, string ); if( params[ 0 ] == playerid )return SendError( playerid, "You cannot teleport to yourself!"); new Float:ParamX, Float:ParamY, Float:ParamZ; GetPlayerPos( params[ 0 ], Float:ParamX, Float:ParamY, Float:ParamZ); SetCameraBehindPlayer( playerid ); SetPlayerInterior( playerid, GetPlayerInterior( params[ 0 ] )); SetPlayerVirtualWorld( playerid, GetPlayerVirtualWorld( params[ 0 ] ) ); if(GetPlayerState(playerid) == 2){ SetVehiclePos( GetPlayerVehicleID( playerid ), ParamX+2, ParamY, ParamZ ); LinkVehicleToInterior( GetPlayerVehicleID( playerid ), GetPlayerInterior( params[ 0 ] )); SetVehicleVirtualWorld( GetPlayerVehicleID( playerid ) , GetPlayerVirtualWorld( params[ 0 ] )); } else { SetPlayerPos( playerid, ParamX+2, ParamY, ParamZ ); } FormMessageForAllEx(playerid && params[ 0 ],COLOR_GREEN, "%s teleported to %s!",PlayerName2( playerid ), PlayerName2( params[ 0 ] )); FormMessage( params[ 0 ], COLOR_GREEN, "%s teleported to you!",PlayerName2( playerid ) ); FormMessage( playerid, COLOR_GREEN, "You teleported to %s!",PlayerName2( params[ 0 ] ) ); return 1; }
CMD:goto(playerid, params[])
{
new string[256],targetid;
if ( sscanf( params, "u",targetid) )return SendClientMessage(playerid, COLOR_ORANGE, "You can use /pgoto <on/off> to disable enable people to come to you"),SendUsage( playerid, "/goto <id>" );
if (P_DATA[targetid][ P_Goto ] == 0 && P_DATA[ playerid ][ P_Level ] < 1 )return format(string,sizeof( string ), "ERROR: %s has the goto turned off.", PlayerName2(targetid)),SendClientMessage(playerid, COLOR_RED, string );
if(targetid == playerid )return SendError( playerid, "You cannot teleport to yourself!");
new Float:ParamX, Float:ParamY, Float:ParamZ;
GetPlayerPos(targetid, Float:ParamX, Float:ParamY, Float:ParamZ);
SetCameraBehindPlayer( playerid );
SetPlayerInterior( playerid, GetPlayerInterior(targetid));
SetPlayerVirtualWorld( playerid, GetPlayerVirtualWorld(targetid) );
if(GetPlayerState(playerid) == 2){
SetVehiclePos( GetPlayerVehicleID( playerid ), ParamX+2, ParamY, ParamZ );
LinkVehicleToInterior( GetPlayerVehicleID( playerid ), GetPlayerInterior(targetid));
SetVehicleVirtualWorld( GetPlayerVehicleID( playerid ) , GetPlayerVirtualWorld(targetid));
} else {
SetPlayerPos( playerid, ParamX+2, ParamY, ParamZ );
}
FormMessageForAllEx(playerid && targetid,COLOR_GREEN, "%s teleported to %s!",PlayerName2( playerid ), PlayerName2( params[ 0 ] ));
FormMessage( targetid, COLOR_GREEN, "%s teleported to you!",PlayerName2( playerid ) );
FormMessage( playerid, COLOR_GREEN, "You teleported to %s!",PlayerName2(targetid) );
return 1;
}
try using a simple targetid variable
pawn Code:
|
CMD:goto(playerid, params[]) { new string[256],targetid; if ([ playerid ][ P_Level ] < 1 )return format(string,sizeof( string ), "ERROR: %s You Can Not Use This Command.", PlayerName2(targetid)),SendClientMessage(playerid, COLOR_RED, string );//7803 here if(targetid == playerid )return SendError( playerid, "You cannot teleport to yourself!"); new Float:ParamX, Float:ParamY, Float:ParamZ; GetPlayerPos(targetid, Float:ParamX, Float:ParamY, Float:ParamZ); SetCameraBehindPlayer( playerid ); SetPlayerInterior( playerid, GetPlayerInterior(targetid)); SetPlayerVirtualWorld( playerid, GetPlayerVirtualWorld(targetid) ); if(GetPlayerState(playerid) == 2){ SetVehiclePos( GetPlayerVehicleID( playerid ), ParamX+2, ParamY, ParamZ ); LinkVehicleToInterior( GetPlayerVehicleID( playerid ), GetPlayerInterior(targetid)); SetVehicleVirtualWorld( GetPlayerVehicleID( playerid ) , GetPlayerVirtualWorld(targetid)); } else { SetPlayerPos( playerid, ParamX+2, ParamY, ParamZ ); } FormMessageForAllEx(playerid && targetid,COLOR_GREEN, "%s teleported to %s!",PlayerName2( playerid ), PlayerName2( params[ 0 ] )); FormMessage( targetid, COLOR_GREEN, "%s teleported to you!",PlayerName2( playerid ) ); FormMessage( playerid, COLOR_GREEN, "You teleported to %s!",PlayerName2(targetid) ); return 1; }
C:\Users\GTA ONLY\Desktop\SAMP\server backup\gamemodes\TE.pwn(2458) : warning 217: loose indentation C:\Users\GTA ONLY\Desktop\SAMP\server backup\gamemodes\TE.pwn(2481) : warning 217: loose indentation C:\Users\GTA ONLY\Desktop\SAMP\server backup\gamemodes\TE.pwn(7803) : error 029: invalid expression, assumed zero C:\Users\GTA ONLY\Desktop\SAMP\server backup\gamemodes\TE.pwn(7803) : warning 215: expression has no effect C:\Users\GTA ONLY\Desktop\SAMP\server backup\gamemodes\TE.pwn(7803) : error 001: expected token: ";", but found "]" C:\Users\GTA ONLY\Desktop\SAMP\server backup\gamemodes\TE.pwn(7803) : error 029: invalid expression, assumed zero C:\Users\GTA ONLY\Desktop\SAMP\server backup\gamemodes\TE.pwn(7803) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.